Auth Token Repository
Component Detail
Data Layer
medium complexity
mobile
0
Dependencies
0
Dependents
2
Entities
0
Integrations
Description
Provides secure persistence and retrieval of authentication tokens and biometric credentials using Flutter Secure Storage. Serves as the single source of truth for the active Supabase session across all authentication methods — email/password, BankID, Vipps, and biometric.
auth-token-repository
Responsibilities
- Store and retrieve Supabase session tokens in Flutter Secure Storage
- Persist biometric credential references linked to user sessions
- Invalidate and clear stored tokens on logout or session expiry
- Provide session validity checks for app startup flow
Interfaces
saveSessionToken(userId, token)
getSessionToken(userId)
deleteSessionToken(userId)
saveBiometricCredential(userId, credentialRef)
getBiometricCredential(userId)
deleteBiometricCredential(userId)
isSessionValid(userId)
clearAllCredentials()
Related Data Entities (2)
Data entities managed by this component