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

Modify jwt iat from valueOf to unix #4

Merged
merged 1 commit into from
Dec 4, 2019

Conversation

AndreiEnache
Copy link
Contributor

iat expressed as seconds from epoch instead of milliseconds from epoch

According to the moment.js docs

moment#valueOf simply outputs the number of milliseconds since the Unix Epoch, just like Date#valueOf. To get a Unix timestamp (the number of seconds since the epoch) from a Moment, use moment#unix.

Since JWTs need a unix timestamp for the iat claim, I modified it accordingly.
This should solve the "Token used before issued" error

iat expressed as seconds from epoch instead of milliseconds from epoch
@hagopj13
Copy link
Owner

hagopj13 commented Dec 4, 2019

@AndreiEnache thank you for pointing it out and creating a PR!

@hagopj13 hagopj13 merged commit b37497d into hagopj13:master Dec 4, 2019
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