
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
- Email Verification Email
Hi everyone, I’m currently experiencing an issue with the email verification functionality. When I trigger the verification, the request returns a valid respon...
- Appwrite Cloud Custom Domains Issue
I’m trying to configure my custom domain api.kondri.lt (CNAME pointing to appwrite.network., also tried fra.cloud.appwrite.io with no luck ) but encountering a ...
- Persistent 401 Unauthorized on all authe...
Hello, I'm facing a critical 401 Unauthorized error on my admin panel app and have exhausted all debugging options. The Problem: When my React app on localhos...
