medium complexity extracted Security & Audit Confidence: 100%
2
Components
39
Shared
0
User Stories
Yes
Analyzed

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

Business Value

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.

Implementation Notes

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)

User Interface (1)

Service Layer (1)

Shared Components

These components are reused across multiple features

User Stories

No user stories have been generated for this feature yet.