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

nbf check is incorrectly implemented #152

Closed
mediamonks-arjan opened this issue Dec 29, 2015 · 2 comments
Closed

nbf check is incorrectly implemented #152

mediamonks-arjan opened this issue Dec 29, 2015 · 2 comments

Comments

@mediamonks-arjan
Copy link

I'm getting this error:

1451384603 '>=' 1451384603
NotBeforeError: jwt not active

From this line:

console.log(payload.nbf, '>=', Math.floor(Date.now() / 1000));

The spec states:
https://tools.ietf.org/html/rfc7519#section-4.1.5

The processing of the "nbf"
claim requires that the current date/time MUST be after or equal to
the not-before date/time listed in the "nbf" claim

In the example above, the current date/time is equal to the not-before date/time, so it shouldn't give an error.
I think the >= should be changed to >, because when equal the nbf should be valid.

@jfromaniello
Copy link
Member

Thanks, fixed in v5.5.1

@mediamonks-arjan
Copy link
Author

Awesome, thanks!

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

No branches or pull requests

2 participants