Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix token exp #235

Merged
merged 28 commits into from
Nov 5, 2024
Merged

Fix token exp #235

merged 28 commits into from
Nov 5, 2024

Conversation

ManziPatrick
Copy link
Contributor

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 in localStorage 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 and npm 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
image

Copy link

vercel bot commented Oct 29, 2024

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 Nov 5, 2024 0:12am

@ManziPatrick ManziPatrick added Ready For Review Extra attention is needed BYTE SWAT BYTE SWAT labels Oct 29, 2024
@Aime-Patrick Aime-Patrick self-requested a review October 31, 2024 07:52
@SHYAKA-Aime SHYAKA-Aime self-requested a review October 31, 2024 10:50
@Salim-54
Copy link

Ignore .lock file

Copy link

codeclimate bot commented Nov 5, 2024

Code Climate has analyzed commit 0599948 and detected 0 issues on this pull request.

View more on Code Climate.

@Salim-54 Salim-54 merged commit 4e2a670 into develop Nov 5, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BYTE SWAT BYTE SWAT Ready For Review Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants