Session Management
Feature Detail
Description
Session Management gives administrators visibility and control over active user sessions across the platform. Administrators can view all currently active sessions for users within their organization, including device type, IP address, location hint, and last activity time. They can revoke individual sessions or all sessions for a given user, immediately invalidating the associated refresh token chain. This capability supports incident response workflows where a compromised account must be locked out instantly without waiting for token expiry.
Analysis
Short-lived access tokens alone are insufficient for security incidents - if a refresh token is compromised, an attacker retains persistent access until the token chain expires naturally. Forced session revocation closes this window immediately and is a standard control expected by enterprise and public-sector customers. For the Meander platform, where peer mentors may share devices or lose phones containing stored tokens, coordinators and org admins need the ability to remotely invalidate sessions without requiring a password reset. This feature also satisfies the GDPR right to erasure boundary: when a user account is deactivated, all active sessions must be terminable on demand to prevent residual access to personal data.
The sessions and refresh_tokens tables already exist in the schema. The SessionRevocationService implements soft-deletion by setting a revoked_at timestamp on the refresh_tokens row and cascading to child tokens. The API HTTP client in the mobile app handles 401 responses by attempting one token refresh; if the refresh token is also revoked, the client clears local credentials and redirects to the login screen. The Active Sessions page is a Next.js SSR page listing sessions per user with a revoke action. Revocation endpoints must require the caller to have Org Admin or Global Admin role, and revocation actions must be written to the audit log. Bulk revocation (revoke all sessions for a user) should be a single atomic operation. Consider adding a last_seen_at column to sessions for display purposes without requiring a write on every API call.
Components (41)
Shared Components
These components are reused across multiple features
User Interface (9)
Service Layer (15)
Data Layer (8)
Infrastructure (7)
User Stories
No user stories have been generated for this feature yet.