Skip to content
This repository was archived by the owner on Aug 7, 2026. It is now read-only.

Fix RefreshToken() - #106

Closed
maverikou wants to merge 1 commit into
supabase-community:masterfrom
maverikou:fix-refreshtoken
Closed

maverikou wants to merge 1 commit into
supabase-community:masterfrom
maverikou:fix-refreshtoken

Conversation

@maverikou

Copy link
Copy Markdown

What kind of change does this PR introduce?

Refresh token never expires. Don't need to check for session expiration when refreshing.
This fixes a bug making it impossible to recover a session after the client has been offline for longer than the expiry time of the access token.

What is the current behavior?

Can't use a refresh token beyond the expiry time of the access token.

What is the new behavior?

Client can now try to refresh the access token for as long as it holds the refresh token.

@maverikou

Copy link
Copy Markdown
Author

Hi. I'm having the same issue here. Is there really any workaround ?

Are you saying this patch doesn't resolve the issue?

@zalito12

Copy link
Copy Markdown

I think this could solve #108

@zalito12

Copy link
Copy Markdown

I tested this changes and, actually, it helps but it doesn't fully fix #108

I needed to make a change in RetrieveSessionAsync. Here it always destroys the session and never try to refresh:

if (CurrentSession != null && CurrentSession.Expired())
{
    _debugNotification?.Log($"Loaded session has expired");
    DestroySession();
    return null;
}

I changed it so it checks if autorefresh is activated, and now it works fine, autorefresh the token everytime I open the app and the session has expired:

if (CurrentSession != null && CurrentSession.Expired() && !Options.AutoRefreshToken)

@Tr00d

Tr00d commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

I confirm this has been fixed.

@Tr00d Tr00d closed this Jul 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants