feat(auth): Implement complete logout functionality with Redis token blacklist and HTTP-only cookie authentication#7
Open
zaibamachhaliya wants to merge 2 commits into
Conversation
- Added api.ts service for backend API calls - Updated Analytics.tsx to fetch real data from backend - Updated MyFiles.tsx with backend integration - Removed all localStorage dummy data - Added file management routes (GET, DELETE, bulk-delete) - Added File model and controller - Added .env.example for environment setup - Fixed Cloudinary upload integration Closes imanchalsingh#1
|
@zaibamachhaliya is attempting to deploy a commit to the imanchalsingh Team on Vercel. A member of the Team first needs to authorize it. |
👷 Deploy request for file-sharingsystem pending review.Visit the deploys page to approve it
|
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
This PR adds complete logout functionality with backend token invalidation using Redis blacklist and HTTP-only cookies for secure authentication.
🚀 What's New?
Backend Changes (8 files)
server/config/redis.jsserver/controllers/userController.jslogoutUserfunction with token blacklistserver/middleware/authenticationUser.jsserver/routes/routers.jsPOST /logoutrouteserver/index.jsserver/package.jsonredisandcookie-parserdependenciesFrontend Changes (7 files)
client/src/components/ProtectedRoute.tsxclient/src/components/Home/Home.tsxhandleLogoutfunction with API callclient/src/components/Authentication/Login.tsxclient/src/components/Authentication/Register.tsxclient/src/services/api.tswithCredentials: trueclient/src/App.tsx/homeroute with ProtectedRouteclient/src/main.tsx🔒 Security Improvements
🧪 Testing Done
/authcall/homeredirects to login after logout📊 Files Changed Summary
redis.js)ProtectedRoute.tsx)🔧 Technologies Used
✅ Related Issue
Closes #6 (Logout Functionality)