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
- Costom domain Issues
Hi Appwrite team We’re having issues verifying a custom domain. We added the required CNAME and CAA records to our DNS provider and waited for at least 2 days a...
- No domain visible after creating functio...
Saw this in docs yet i have no domain (Pro): ``` Generated domains In the Appwrite Console's sidebar, click Functions. Under the Domains tab, you'll find the g...
- Confusion around Tables / TablesDB vs Da...
Hello everyone, I ran into quite a bit of confusion when trying to migrate a Function from Databases.createDocument() to the new Tables / Rows API and wanted t...