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 expired #218 #221

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open

fix token expired #218 #221

wants to merge 3 commits into from

Conversation

ManziPatrick
Copy link
Contributor

@ManziPatrick ManziPatrick commented Oct 22, 2024

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 22, 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 Oct 26, 2024 4:32pm

@Aime-Patrick Aime-Patrick self-requested a review October 22, 2024 08:51
@iChris-tian iChris-tian self-requested a review October 22, 2024 08:53
@berniceu berniceu self-requested a review October 22, 2024 10:56
Copy link

codeclimate bot commented Oct 26, 2024

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

View more on Code Climate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants