Fix tokens not refreshing when calling RefreshToken() or RetrieveSessionAsync() #109
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
Removed the expiry checks from RefreshToken() and RetrieveSessionAsync() to fix tokens not refreshing when access token is expired.
What is the current behavior?
When RetrieveSessionAsync() is called the expiry is checked and assumes that the session is invalid.
The same check happens in RefreshToken() before actually trying to refresh it, causing it to never properly try to refresh the tokens.
What is the new behavior?
If the access token has expired and AutoRefreshToken is enabled RetrieveSessionAsync() wil try to refresh the tokens.
And when manually calling RefreshToken() the method will continue to refresh the token
Additional context
It seems like it was assumed that the expiry was for the whole session, but it is specifically for the access token.
This would close issue #108 and PR #106