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
- 1.8.1 - Databases - inline updating a ro...
When updating a database field via the inline edit method, the `$updatedAt` column does not get updated. Only if the row is updated by the "Update" interface (t...
- Other DateTime Columns Are Saved Incorre...
When opening a row’s details from the console and editing any field, the timestamps of other DateTime columns are being automatically changed and incorrectly sa...
- GOT 500 error when going to the appwrite...
I gott 500 internal error screen and my API is timeout. please help to take a look. Traceback (most recent call last): File "D:\conda\envs\wrista\Lib\site-pa...