Rank 2: Process
- I login user with google auth,
- create and send jwt to the server
- setJwt on appwrite client (client....setJwt(jwt))
- calling account.getSession("current") says
user_session_not_found
Votes
0
Replies
11
Participants
Unknown
Messages
12
Rank 2: Process
user_session_not_foundRank 2: Process
Why?
Rank 2: Process
my current solution is to set jwt and session_id in a browser cookie and send it over to the server on every request to perform actions
Rank 2: Process
is this is ok?
Yep, this is a one valid way to do so.
it might be good to create a github issue for this. I think there's a slight bug in the get session api when dealing with JWT tokens.
this is interesting...i've been exploring this approach as away to deal with SSR 👀
On the server side, you should use the getAccount() rather than getSession("current") to validate the JWT works. getAccount() is faster than getSession() too
Rank 2: Process
@Steven There is no such suggestion from typescript (or in documentation) as getAccount
getAccount(account.get) is an appwrite endpoint. Look here: https://appwrite.io/docs/server/account?sdk=nodejs-default#accountGet
The endpoint is available on the server and client side
I've linked the server-side docs though, just saying lol
Sorry, it's account.get().