@everyone
I just started using AppWrite.
I'm looking for a way to check whether there is a running session on page load and load the user data if the session exist.
The only way I found is to use the the following:
async restoreSession() { const account = new Account(appWriteClient); try { sessionModel.userData = await account.get(); } catch (error) { //well, not an error as such, just not restoring the session } }The issue is that when no session is available the API call will generate a 401 error that will display in the console. Not very graceful.
Is there a way to do an offline check, short of checking for the presence of localStorage.get('cookieFallback')?
Thanks