TokenStore
Component Detail
Infrastructure
medium complexity
mobilefrontend
0
Dependencies
0
Dependents
0
Entities
0
Integrations
Description
Provides platform-appropriate secure storage for authentication tokens, using the device secure store on mobile and HTTP-only SameSite cookies on the admin portal. It abstracts the storage mechanism so AuthService and LoginScreen can read and write tokens without being aware of the underlying platform.
token-store
Sources & reasoning
Line 42 explicitly designates email/password as the MVP login method, with BankID/Vipps deferred to Fase 2. Line 319 repeats this in the Fase 1 MVP scope list. This is the entry-point authentication mechanism that unblocks all other features at launch, mapping to MVP by ordinal phase position.
-
docs/source/likeperson.md · line 42**MVP leveres med e-post/passord-innlogging; BankID og Vipps ruller ut i Fase 2**
-
docs/source/likeperson.md · line 319E-post/passord innlogging (BankID/Vipps i fase 2)
Responsibilities
- Write access and refresh tokens to platform-appropriate secure storage after login
- Read stored tokens for outgoing authenticated requests and refresh flows
- Clear all stored tokens on logout or session revocation
- Configure HTTP-only SameSite cookie attributes for the admin portal context
- Expose a unified interface across mobile and web execution contexts
Interfaces
saveTokens(accessToken: string, refreshToken: string): Promise<void>
getAccessToken(): Promise<string | null>
getRefreshToken(): Promise<string | null>
clearTokens(): Promise<void>