validator.js
validator.js copied to clipboard
Feat/addedISJWTExpiriation
I have added a new function called isJWTExpiration. This function is designed to check if a JSON Web Token (JWT) has expired based on its "exp" (expiration) claim. It parses the JWT payload, extracts the "exp" claim, and compares it to the current timestamp to determine if the token has expired.
#2298
Checklist
- [x] PR contains only changes related; no stray files, etc.
- [ ] README updated (where applicable)
- [ ] Tests written (where applicable)
- [ ] References provided in PR (where applicable)
Codecov Report
Attention: 10 lines in your changes are missing coverage. Please review.
Comparison is base (
b958bd7) 99.95% compared to head (75e36d4) 99.55%.
Additional details and impacted files
@@ Coverage Diff @@
## master #2315 +/- ##
==========================================
- Coverage 99.95% 99.55% -0.41%
==========================================
Files 107 108 +1
Lines 2454 2461 +7
Branches 619 621 +2
==========================================
- Hits 2453 2450 -3
- Misses 0 10 +10
Partials 1 1
| Files | Coverage Δ | |
|---|---|---|
| src/index.js | 100.00% <100.00%> (ø) |
|
| src/lib/isJWTExpiration.js | 9.09% <9.09%> (ø) |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.