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(jwt): Fix ttl in claims #846

Merged
merged 4 commits into from
Aug 2, 2023
Merged

fix(jwt): Fix ttl in claims #846

merged 4 commits into from
Aug 2, 2023

Conversation

dragonmantank
Copy link
Contributor

Description

When passing in a ttl to generate a new token, we accidentally leave the ttl parameter in the claims. This is causing a problem with tokens being rejected. The exp is calculated properly, but we just leave the additional ttl claim there due to object unpacking.

Motivation and Context

This breaks JWT validation

Testing Details

Added a unit test

Example Output or Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@codecov-commenter
Copy link

codecov-commenter commented Aug 2, 2023

Codecov Report

Merging #846 (9f5fc1a) into 3.x (8760b0f) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##              3.x     #846      +/-   ##
==========================================
+ Coverage   83.42%   83.44%   +0.02%     
==========================================
  Files         119      119              
  Lines        1484     1486       +2     
  Branches      282      283       +1     
==========================================
+ Hits         1238     1240       +2     
  Misses        245      245              
  Partials        1        1              
Files Changed Coverage Δ
packages/jwt/lib/jwt.ts 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@dragonmantank dragonmantank requested a review from manchuck August 2, 2023 17:37
@manchuck manchuck merged commit 54fccdc into 3.x Aug 2, 2023
@manchuck manchuck deleted the fix-ttl-in-claims branch August 2, 2023 17:41
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.

3 participants