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

Jwt expiration verify #2310

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

VatsalBhuva11
Copy link

Changes

feat(isJWTExpired): check if a JWT token is expired or not by comparing with the current time and the expiration time. Returns true if the token is expired/invalid, and false if it is a valid token that has not expired or has no expiration set.

Process

I created a separate validator called isJWTExpired.js, that checks if a given JWT Token is beyond it's expiry or not. It also makes use of the isJWT validator to check if the string is a valid JWT token in the first place or not. Post that, I've checked whether the current time has exceeded the expiration time, which indicates that the token has expired.

Feat: #2298

Checklist

  • PR contains only changes related; no stray files, etc.
  • README updated (where applicable)
  • Tests written (where applicable)
  • References provided in PR (where applicable)

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

Successfully merging this pull request may close these issues.

1 participant