feat: integrate Redis-based session management and improve authentication flow#210
Merged
RUKAYAT-CODER merged 2 commits intoMar 24, 2026
Merged
Conversation
…tion flow - Added @nestjs/platform-socket.io for WebSocket support. - Introduced session management using Redis with a new SessionModule and SessionService. - Updated AuthService to handle session creation and management during user registration and login. - Enhanced logout functionality to invalidate sessions. - Implemented distributed locking for session operations to prevent race conditions. - Refactored cache configuration to use a dedicated cacheConfig file. - Added GraphQL schema for assessments and courses. - Improved error handling for Redis connections across various services. - Enabled sticky sessions and cluster mode support in the main application bootstrap.
|
@Mkalbani Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Summary
Linked Issue
Closes #201
What does this PR do?
This PR introduces Redis-backed session handling to support horizontal scaling and more reliable auth state management across multiple application instances. The authentication flow now creates, refreshes, and invalidates sessions explicitly, while critical session operations are wrapped in distributed locks to avoid concurrency issues. The change also centralizes cache/session configuration, improves Redis error resilience, and prepares the application for clustered deployment and sticky-session load balancing.
Type of change
Pre-merge checklist (required)
Branch & metadata
Code quality & tests
Error handling & NestJS best practices
API documentation / Swagger
Breaking changes
Breaking change description (if applicable)
Not applicable.
Test evidence (required)
Commands run locally
Pending final pre-merge verification. Recommended commands:
Manual / API verification
Pending final local verification before merge. Recommended checks:
Screenshots / recordings (if applicable)