Repository navigation
Fix tokens not refreshing when calling RefreshToken() or RetrieveSessionAsync() - #109
pBlackCreek wants to merge 1 commit into
Conversation
|
I think there is also a problem in the TokenRefresh, were the client signsout the user in the refresh token function, by checking the access token expiry date instead: |
|
@pBlackCreek I'm the new maintainer of the Supabase C# SDK. |
@Tr00d my PR that was merged has addressed this. Let me know if you need any help |
|
@azegallo I saw that, but I didn't see any release for that fix Give me some time, I need to assess the state of each package. It's fair to assume every package has some unreleased fixes/features. |
|
I confirm this has been fixed already. |
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