Data Layer medium complexity Shared Component backend
0
Dependencies
3
Dependents
3
Entities
0
Integrations

Description

Data access layer for persisting and retrieving authentication tokens, session records, and identity provider linkages. Shared with the Email & Password Login feature and serves as the single source of truth for all auth state in the platform.

Feature: BankID & Vipps Authentication

auth-token-repository

Responsibilities

  • Persist and retrieve platform JWT session tokens
  • Store identity provider linkage records (BankID/Vipps subject identifiers)
  • Invalidate and clean up expired or revoked tokens
  • Query active sessions by user ID or token value

Interfaces

saveToken(userId, token, expiresAt)
findTokenByValue(tokenValue)
findTokensByUserId(userId)
revokeToken(tokenValue)
revokeAllUserTokens(userId)
saveIdentityLink(userId, provider, subject)
findIdentityLink(provider, subject)
deleteIdentityLink(userId, provider)
cleanupExpiredTokens()

Related Data Entities (3)

Data entities managed by this component