Sessions Table
Component Detail
Data Layer
medium complexity
Shared Component
backend
0
Dependencies
2
Dependents
0
Entities
0
Integrations
Description
Data repository for active user sessions and their associated opaque refresh tokens. Persists session state across requests to support silent token refresh and clean session termination. Enforces single-use refresh token rotation and supports revocation by session or by user.
sessions-table
Responsibilities
- Persist session records linked to users and tenant IDs
- Store opaque refresh tokens and enforce single-use rotation
- Support session revocation by session ID or by all sessions for a given user
- Expose session listing for the admin Session Management feature
Interfaces
createSession(userId: String, tenantId: String, refreshToken: String) → Session
findByRefreshToken(token: String) → Session?
rotateRefreshToken(sessionId: String, newToken: String) → void
revokeSession(sessionId: String) → void
revokeAllUserSessions(userId: String) → void
listActiveSessions(userId: String) → List<Session>
Relationships
Dependents (2)
Components that depend on this component