Skip to content

Conversation

@ryan-sandy
Copy link
Contributor

This PR fixes an inconsistency with timestamps within the project.

The current code treated the expires_in and x_refresh_expires_in as timestamps if they were passed in as constructor parameters. If a token was set using the setToken the expires_in and x_refresh_expires_in became timestamps from Date.now(). This lead to inconsistent behavior in the validation methods depending on how you created the token.

To handle stored tokens, an optional createdAt parameter was created. This stored tokens to have the correct expiration date, instead of using Date.now().

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