user session management#344
Merged
Merged
Conversation
BigBen-7
approved these changes
Sep 1, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
✅ Implementation Complete
This PR delivers a full enterprise-grade session management system with device tracking, JWT invalidation, and advanced security monitoring capabilities.
Users can now view their active sessions/devices, revoke individual sessions, or perform bulk session revocations.
Related Issues
Closes #281
Changes Made
Core Components Delivered
UserSessionEntity – Complete session tracking with IP, device, browser, OS, and geolocation detailsSessionManagementService– Full CRUD operations and JWT invalidation supportSessionTrackingService– Automatic session creation from HTTP requestsGeoLocationService– IP-based geolocation lookupSessionManagementController– REST API with 6 session management endpointsSessionValidationGuard– JWT validation integrated with session checksSessionJwtStrategy– Enhanced JWT strategy with session validationKey Features Implemented
API Endpoints Available
GET /sessions– List user sessionsGET /sessions/:id– Retrieve specific session detailsDELETE /sessions/:id– Revoke a specific sessionPOST /sessions/revoke-all– Bulk revoke sessionsDELETE /sessions– Alternative bulk revocationFiles Created
user-session.entity.tssession-management.service.ts,session-tracking.service.ts,geo-location.service.tssession-management.controller.tssession-validation.guard.tssession-jwt.strategy.tscreate-session.dto.ts,session-response.dto.tssession-management.module.tsREADME.mdwith setup and usage instructionsHow to Test
/sessionsto see active sessions.DELETE /sessions/:id.POST /sessions/revoke-all.Screenshots (if applicable)
N/A (API endpoints only).
Checklist
README.md).