
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
- unexpected row_invalid_structure error
In images you can see both my code,error, column schema I do have timezone in table schema but still while creating a row i am receving row_invalid_structure e...
- Internal 500 Server Error
I don't have much information but I am unable to create anything on database, Auth users are creating but not able to fetch into database
- CORS + 401 Error with Appwrite Authentic...
I'm getting a CORS + 401 Error with Appwrite Authentication Access to fetch at 'https://cloud.appwrite.io/v1/account/sessions/email' from origin 'https://my-c...
