JWT fails with error: Failed to verify JWT. Invalid token: Incomplete segments
- 0
- Self Hosted
- Accounts
- Web

So I am trying to setup SSR authentication on my Nextjs project. The flow is:
- Authenticate using OAuth
- Get secret key from
/auth/oauth2/success
and save as cookie
On page request:
- Get cookie (secret key)
- Set jwt using
client.setJWT(secretkey)
- Get current user using
account.get()
Then I get this error: Failed to verify JWT. Invalid token: Incomplete segments

Yes because the session cookie is not the same thing as a JWT. You can't use them interchangeably

Basicly i think (my oppinion) that best way is to use appwrite sdk for client on server side. And when you want to implement your api key you just will have to use sdk for node.js

only think you have to do is to set header into appwrite client "X-Fallback-Cookies"
Recommended threads
- Attribute already exists in schema
I created an attribute, deleted it and now I can't create it again. It says "Failed" and "Attribute already exists in schema". ```json { "27": { "ke...
- Decentralisation
I had queries regarding decentralisation with self hosting, particularly with sites as a recent addition. Can we decentralise sites as in many cases we would li...
- Error response from daemon: driver faile...
on endpoint appwrite-traefik (00bbc10e5875d0c367d8975c6abc946a77b7ec201a64a825399add44fb34ebb4): failed to bind port 0.0.0.0:80/tcp: Error starting userland pro...
