HoXsanOriginal post
Rank 1: Thread
So I am trying to setup SSR authentication on my Nextjs project. The flow is:
- Authenticate using OAuth
- Get secret key from
/auth/oauth2/successand 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
Summary
The user is trying to set up SSR authentication on a Next.js project using OAuth. They are encountering an error message that says "Failed to verify JWT. Invalid token: Incomplete segments." One suggestion from another user is to set the header "X-Fallback-Cookies" in the Appwrite client. Additionally, it is recommended to use the Appwrite SDK for the server-side client and the SDK for Node.js for implementing the API key. The user should also note that a session cookie is not the same as a JWT and they cannot be used interchangeably. No solution is provided in the thread for the specific error message mentioned.