Hi,
I'm evaluating Appwrite for my Flutter app and need clarification on handling offline login sessions.
My app requires users to log in, with the session cached locally to allow offline access. Previously, I used Firebase Auth, which provided a local session cache. On app launch, I checked for a cached user and allowed offline app usage if present.
With Appwrite's Flutter SDK, I understand that Account.get() checks for an active user session but makes a backend call, which fails in offline mode. Is this correct, or am I missing a built-in offline session handling feature?
As a workaround, I'm considering the following approach:
After a successful login, cache the JWT token (or another user-specific property) locally. On app launch, attempt Account.get(). If it fails due to offline mode, check for the cached token. If present, assume an active session and allow offline access. When the app is online, validate the cached token by exchanging it for an active session or triggering a re-login if the session is invalid. Clear the cached token on logout or when an online check confirms no active session. Is this a recommended approach for offline login caching with Appwrite, or is there a better solution or built-in feature I should use?
Thank you for your guidance!
Recommended threads
- Introducing new string column types made...
Adding new string types is hugely bennificial! Unfortunately it made the current column types not editable to change their types to the new longer field types.
- there is critical problem in this part
when user update the integer and double both get error not update or upload
- how can i make a relationship between a ...
i want to relate the $id from users auth table in appwrite with other column in my table user_profile. because is the same user... how can i have exactly the s...