| title | Authentication Logoff Flow | |||||
|---|---|---|---|---|---|---|
| description | Technical documentation of user logoff process from all devices | |||||
| detail_level | Implementation details | |||||
| tags |
|
|||||
| revised | false |
This document describes the logoff process in meows.space, which allows users to terminate all active sessions across all devices simultaneously.
sequenceDiagram
participant User
participant Browser
participant AuthService
participant SessionManager
participant Database
participant EmailService
%% Initiate Logoff
User->>Browser: Access Security Settings
Browser->>User: Display Security Options
User->>Browser: Select "Logoff All Devices"
Browser->>User: Display Confirmation Dialog
%% Verification Process
User->>Browser: Confirm Logoff Intent
Browser->>AuthService: Request Global Logoff
alt Requires Verification
AuthService->>User: Request Additional Verification
User->>Browser: Provide Verification (Password/2FA)
Browser->>AuthService: Submit Verification
AuthService->>AuthService: Validate Verification
end
%% Session Termination Process
AuthService->>SessionManager: Initiate Global Logoff
SessionManager->>Database: Query All Active Sessions
Database-->>SessionManager: Return Active Sessions
loop For Each Session
SessionManager->>Database: Invalidate Session Token
SessionManager->>Database: Revoke Refresh Token
end
%% Security Timestamp Update
SessionManager->>Database: Update Security Timestamp
%% Current Session Handling
SessionManager->>Browser: Invalidate Current Session
Browser->>Browser: Clear Local Storage/Cookies
%% Notification
AuthService->>EmailService: Generate Security Notification
EmailService->>User: Send Logoff Confirmation Email
%% Completion
Browser->>User: Display Logoff Success
Browser->>User: Redirect to Login Page
-
Access Point
- User accesses security settings through account menu
- System displays security management options
- User selects "Logoff from all devices" option
- System displays confirmation dialog explaining the action
-
Verification
- System may require additional verification for security
- Verification methods include:
- Password confirmation
- Two-factor authentication code
- Email verification link
- User completes verification step
- System validates identity before proceeding
-
Session Identification
- System queries database for all active sessions associated with user
- Sessions are identified by:
- Session tokens
- Refresh tokens
- Device information
- IP addresses
- Last activity timestamps
-
Token Revocation
- System invalidates all session tokens in database
- All refresh tokens are revoked to prevent regeneration
- Security timestamp is updated to invalidate any cached tokens
- Authentication servers are notified to reject any existing tokens
-
Current Session Handling
- Current session is terminated last
- Local storage and cookies are cleared from current browser
- User is redirected to login page with appropriate message
-
Notification
- System sends security notification email containing:
- Confirmation of global logoff action
- Timestamp of the action
- Approximate number of sessions terminated
- Instructions if action was not initiated by user
- System sends security notification email containing:
-
Audit Trail
- System logs the global logoff event with:
- Timestamp
- Initiating device information
- IP address
- Number of sessions terminated
- This information is available in the user's security log
- System logs the global logoff event with:
The global logoff feature is particularly useful in several scenarios:
-
Security Concerns
- User suspects unauthorized access to their account
- User notices suspicious activity in their usage history
- User receives notification of login from unknown location
-
Device Management
- User has lost a device with active sessions
- User has changed employment and used work devices
- User wants to ensure no sessions remain on shared computers
-
Account Maintenance
- User has changed critical account information
- User is performing security audit of their accounts
- User wants to ensure clean state across all devices
- Network issues during logoff process are handled with retry mechanisms
- Partial logoff completion is detected and reported
- Failed logoffs trigger appropriate error messages with support options
- System monitors for unusual logoff patterns that might indicate attacks
- Login/Logout Flow
- Session Management (Documentation moved)
- Token Revocation (Documentation moved)
- Security Settings