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

bug: jti not used during JWT.sign #33

Closed
2 tasks done
alvis opened this issue Jul 14, 2019 · 3 comments
Closed
2 tasks done

bug: jti not used during JWT.sign #33

alvis opened this issue Jul 14, 2019 · 3 comments
Labels
bug Something isn't working

Comments

@alvis
Copy link

alvis commented Jul 14, 2019

When using JWT.sign, jti can be supplied as an option for it to be included in the payload.
However, jti is currently not included in the payload generation
see below:

jose/lib/jwt/sign.js

Lines 65 to 74 in 10a1b64

payload = {
...payload,
sub: subject || payload.sub,
aud: audience || payload.aud,
iss: issuer || payload.iss,
iat: iat ? unix : payload.iat,
nonce: nonce || payload.nonce,
exp: expiresIn ? unix + secs(expiresIn) : payload.exp,
nbf: notBefore ? unix + secs(notBefore) : payload.nbf
}

Additional context
Add any other context about the problem here.

  • the bug is happening on latest @panva/jose too.
  • i have searched the issues tracker on github for similar issues and couldn't find anything related.
@alvis alvis added the bug Something isn't working label Jul 14, 2019
@panva panva changed the title bug: missing jti in JWT.sign question: autogenerate jti during JWT.sign Jul 14, 2019
@panva panva added question Further information is requested bug Something isn't working and removed bug Something isn't working question Further information is requested labels Jul 14, 2019
@panva panva changed the title question: autogenerate jti during JWT.sign bug: jti not used during JWT.sign Jul 14, 2019
@panva
Copy link
Owner

panva commented Jul 14, 2019

@alvis thank you, i can see the issue now. (after having a second look) definitely something to fix to behave as documented.

@alvis
Copy link
Author

alvis commented Jul 14, 2019

Thank you @panva ;)

@panva panva closed this as completed in 36c9ce2 Jul 14, 2019
@panva
Copy link
Owner

panva commented Jul 14, 2019

@alvis v1.4.1

@github-actions github-actions bot locked and limited conversation to collaborators Apr 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants