
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 jwtVal
and 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
- Subdomain failed verification
So I wanted to do a custom subdomain, because local storage doesn't work for me, but I've tried it a long time ago, it didn't work for me, and now I'm trying ag...
- Query params are way too limiting in ter...
I was trying to list rows in a table that do not already exist in another table. I retrieved around 260 row IDs which are 13 characters in length each, and then...
- [Node.js SDK] Bypass 2GB file limit?
Hello. Using either InputFile.fromPath or InputFile.fromBuffer throws this error: File size (2295467305) is greater than 2 GiB Bucket limit etc. is setup corre...
