I get logged in server side and no problem setting the cookie.
When i try to use it to create a document using REST:
const response = await fetch(`${AppwriteEndpoint}/databases/${Database.name}/collections/${Collection.test}/documents`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Appwrite-Response-Format': '1.0.0',
'X-Appwrite-Project': AppwriteProject,
'X-Appwrite-JWT': jwtVal
},
body: JSON.stringify(body)
});
I get a invalid token as a response. I console logged the token jwtValand it matches what is in the cookie.
not sure what the problem is.
{
message: 'Failed to verify JWT. Invalid token: Incomplete segments',
code: 401,
type: 'user_jwt_invalid',
version: '1.3.8'
}
A JWT is not a cookie. You can't use them interchangeably
oh ok.
[CLOSED] Failed to verify JWT
Recommended threads
- Cant get realtime working
Hey I nned some help with realtime a gain. I was using client.subscribe(...), and i found out that its depricated then i believe realtime.subscribe(...) is the ...
- Firebase app import
I'm **very** new to appwrite and I just set up appwrite with docker and I'm trying to import a Firebase app I have set up but it's erroring and I don't really k...
- Hi Folks, Database Writing Issue
Hey Folks im trying to get logging setup on my website but im getting an error, i dont have any document id and i think this is the issue but i havent got the f...