Skip to content

maxAge option incorrectly handles values expressed in number of milliseconds #346

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

Closed
zaak opened this issue May 2, 2017 · 2 comments
Closed
Labels

Comments

@zaak
Copy link

zaak commented May 2, 2017

As stated in the docs:

maxAge: the maximum allowed age for tokens to still be valid. Currently it is expressed in milliseconds or a string describing a time span zeit/ms. Eg: 1000, "2 days", "10h", "7d". (...)

But if you pass a number, it's converted to string by ms call here, as there's no typeof check for options.maxAge. Because of this all the following validation logic is broken in this case.

@ziluvatar ziluvatar added the bug label May 13, 2017
@ziluvatar
Copy link
Contributor

ziluvatar commented May 13, 2017

Thanks @zaak!! There was an issue about how using milliseconds does not match quite well with JWT, however, we didn't realize that it actually does not work at all. The good part is that we can fix both at same time, making the code work with number (only for seconds) right away.

@ziluvatar
Copy link
Contributor

Fix: #349

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants