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.

Feature: Email & Password Login

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.

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>