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

Not Before (nbf) calculated based on iat/timestamp #437

Merged
merged 1 commit into from
Jan 19, 2018
Merged

Not Before (nbf) calculated based on iat/timestamp #437

merged 1 commit into from
Jan 19, 2018

Conversation

MitMaro
Copy link
Contributor

@MitMaro MitMaro commented Jan 11, 2018

See #435

Set nbf value based on the timestamp.

var token = jwt.sign({foo: 123, iat: iat}, '123', {notBefore: notBefore});
var result = jwt.verify(token, '123');
expect(result.nbf).to.be.closeTo(iat + notBefore, 0.2);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since the timestamp will be the iat, shouldn't it be equal always (instead of "closeTo")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree completely! I was following the previous test example to keep the style the same, but I will gladly update.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to check for direct equals.

@ziluvatar ziluvatar merged commit 2764a64 into auth0:master Jan 19, 2018
@MitMaro MitMaro mentioned this pull request Jun 14, 2018
23 tasks
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.

2 participants