Closed ManziPatrick closed 3 weeks ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
atlp-devpulse-fn | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Oct 26, 2024 4:32pm |
Code Climate has analyzed commit f4fa17c6 and detected 0 issues on this pull request.
View more on Code Climate.
PR Description: Implement Token Expiration After One Hour
This PR implements token expiration functionality that automatically logs out users after one hour of token issuance to enhance session security.
Tasks Completed:
Token Expiration Logic: Added a
TOKEN_ISSUED_TIME
field inlocalStorage
to track when the token was issued.Expiration Check: Implemented logic to check if the token has expired one hour (3600 seconds) after issuance.
Automatic Logout: If the token has expired, the user is logged out, localStorage is cleared, and the user is redirected to the login page with a session expiration message.
How Has This Been Tested?
Clone the repo.
Checkout the branch
ft-token-expiration
.Run
npm install
andnpm run dev
to start the app.Validate token expiration by waiting for one hour and checking if the session automatically logs out.
Test on various routes to ensure expired tokens trigger the logout flow.
Tracking Issue
Resolves: [Issue #218]
Screenshots
After token timeout