- 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
Why?
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
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
@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()
.
Recommended threads
- Upgrade Issue
Am having issue upgrading my appwrite account to pro as my card number is 19 and the required input is 16 digit
- createEmailPasswordSession Error using S...
Did someone succeed using SSR approach for login?
- [Solved] how to get user prefs from serv...
i want to get a specific users preferences from serverside maybe i missunderstood something