What is the best way to check if a user session exists? We are using the Web SDK and using either account.get() or account.getSession('current')
however, when a user isn't logged in we get a 401 response which throws an error in the console.
is there a better way to be checking for user session?
account.get() is the best way. if it executes successfully, they are logged in. Otherwise, check the error
Hey Steven! Thanks for the quick response. Will the error show in the console of the browser in production?
Recommended threads
- Failed to receive appwrite reset passwor...
Hey there, I forgot my password for my appwrite account but when i use forgot password, i dont get an email to reset the account but when i try to create a new ...
- Opening Project I get "500 Internal Erro...
Opening Project I get "500 Internal Error" added what i see on the page and in dev console
- Envvar editor var count mismatch
It shows i got 30 vars, but i can only count 22 + 3 secret. It's very confusing. Can't figure if it is hiding some or just counting wrong.