-
Notifications
You must be signed in to change notification settings - Fork 692
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
OAuthService hasValidAccessToken wrongly returns true #1214
Comments
Perhaps a duplicate of #1135? |
It also returns "true" if the Token endpoint erroneousely returns an empty JSON ("{}") in response body. In such case the library stores the string "undefined" as an access_token value, and hasValidAccessToken() returns "true". |
When the access token response doesn't have an expiration time (which is also the case when it's an empty object), you can set the config property |
Feel free to reopen this issue if I'm wrong here. |
I don't think I understand this comment, my access token response does have an expiration time so I don't need to use a fallback as far as I know. The bug the OP mentioned still happens. edit: ok I understand now that I need to adjust "clockSkewInSec" in the auth config |
Describe the bug
hasValidAccessToken returns true even though expired_at in local storage is a minute before now.
Additional context
the hasValidAccessToken function subtracts getClockSkewInMsec (10min by default) from now and compares the expiresAt against that value.
So a token is considered invalid only 10minutes after it it is expired
The text was updated successfully, but these errors were encountered: