We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
iat
nbf
Related Issue: #142
The calculation of payload.nbf does not use payload.iat when notBefore is passed an offset, and instead the current time is always used.
payload.nbf
payload.iat
notBefore
In this case I would expect that the payload.nbf value to be an offset based on the passed payload.iat. This would be consistent with payload.exp.
payload.exp
const {sign, decode} = require('jsonwebtoken'); const token = sign({foo: 'bar', iat: 100}, 'secret', {notBefore: '-1s'}); const decoded = decode(token); console.log(`Expecting nbf value ${decoded.nbf} to equal 99`); > Expecting nbf value 1513884708 to equal 99
It seems that the timestamp is not passed to timespan function on Line 148 of sign.js similar to how it is passed to the call on Line 155 of sign.js.
timestamp
timespan
The text was updated successfully, but these errors were encountered:
I would be willing to put up a PR fixing the issue with tests if this is not by design.
Sorry, something went wrong.
@MitMaro I think this simply wasn't fixed when the timestamp was introduced for exp. #217. Be free to send a PR.
exp
2764a64
No branches or pull requests
Related Issue: #142
Problem Description
The calculation of
payload.nbf
does not usepayload.iat
whennotBefore
is passed an offset, and instead the current time is always used.Expected
In this case I would expect that the
payload.nbf
value to be an offset based on the passedpayload.iat
. This would be consistent withpayload.exp
.Reduced Test Case
Investigation
It seems that the
timestamp
is not passed totimespan
function on Line 148 of sign.js similar to how it is passed to the call on Line 155 of sign.js.The text was updated successfully, but these errors were encountered: