
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
- Migration to new region: not so good.
We attempted to do a migration to NYC... and things didn't go well. We followed the steps (exactly) as shown in the video, updated our app with the new endpoint...
- Image Loading issue in Snapgram project
Hello community, I have a issue with the Image Loading I made a Project from youtube of Snapgram, it worked perfectly 8 months ago, but now the images aren't l...
- No Targets Created For Email OTP Users
I use OTP for my users. All emails are verified. No one has their email as a target. What am I doing wrong? The documentation says the targets should be created...
