Skip to content

Fix/refresh token optional #924

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

Closed

Conversation

thomasconner
Copy link

What kind of change does this PR introduce?

Bug fix - Supabase client will ignore autoRefreshToken setting when setting a session with an expired access token
Breaking Change - Session type now has refresh_token as optional

What is the current behavior?

When a Supabase client is initialized with auto refresh token disabled

const client = createClient(options.supabaseUrl, options.supabaseKey, {
    auth: { autoRefreshToken: false }
});

but a session is set with client.setSession() and the access token is determined to be expired the client will disregard the autoRefreshToken setting and attempt to refresh the token.

What is the new behavior?

The client will abide by the autoRefreshToken setting and not refresh a session if auto refresh token is disabled and the access token provided when setting the session has expired.

@thomasconner thomasconner deleted the fix/refresh-token-optional branch June 17, 2024 16:27
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.

1 participant