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
- general_route_not_found - Auth Guide
If you’ve just added a subdomain to your project, verified your DNS records, and confirmed your SSL certificate is working, but you're still hitting a `general_...
- Can't resume paused project
I have logged in in incognito, done the email verification and still get the invalid fingerprint error. What's the issue.
- Download appwrite Docs
Is there is a way to download appwrite Docs ? Because appwrite skill isn't enough to give the agent full understanding about how appwrite works (I noticed this ...