When restarting my app, is there a way I can have the user log back in using the session object, so the user doesn’t have to re-enter their credentials?
TL;DR
The SDK automatically persists sessions, so the user is already authenticated when they return to the app. On app start, you can call `account.get()` to check if the user is authenticated. If it returns successfully, you can redirect them into the app. If an exception is thrown, redirect them to the login page. Thus, there is no need for the user to re-enter their credentials.Since the SDK automatically persists sessions, the user is already authenticated the next time they come back to your app.
The typical pattern is to do the following on app start:
- Call
account.get()2a. If that returns successfully, the user is already authenticated and you can redirect them into the app. 2b. If an exception is thrown, they don't have a session so redirect them to the login page
Recommended threads
- hi guys! my site is not accesible in my ...
- MongoDb Database Breaks integer[] & bigi...
I've got a table with the below column created. When I try to insert the value `[-3408048000]` into it, the dart sdk cloud function call is successful (no error...
- Delete on cascade from Cloud Function
I'm writing a Python function that deletes a user's main row from a table in my database. This row has relationships with other tables that use cascade deletion...