Skip to content
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

New token refresh algorithm on gotrue-js #317

Closed
dshukertjr opened this issue Dec 28, 2022 · 2 comments · Fixed by #879
Closed

New token refresh algorithm on gotrue-js #317

dshukertjr opened this issue Dec 28, 2022 · 2 comments · Fixed by #879
Labels
auth This issue or pull request is related to authentication enhancement New feature or request

Comments

@dshukertjr
Copy link
Member

*Posting this without reading too much into the context, so might not be relevant for us, but wanted to get it out there for visibility.

Gotrue-js is updating their token refresh algorithm, here. Might be something worth looking into!
supabase/auth-js#564

Personally, I think the current implementation is okay though unless someone knows any issues.

@dshukertjr dshukertjr added enhancement New feature or request auth This issue or pull request is related to authentication labels Dec 28, 2022
@matthewwong525
Copy link

matthewwong525 commented Jan 4, 2023

So my supabase app supports offline usage (through flutter) and oftentimes if I get reports of my users being automatically "logged out". This is because the refresh token algorithm has trouble actually getting a refresh once the internet connection has been restored. Anyways, my solution to this was to periodically refresh the token (before it's expired) and set the expiration date to 7 days (maximum).

@d-e-h-i-o
Copy link

Our users also get logged out sometimes. Often the following exception is thrown:
AuthException('Access token refresh retry limit exceeded.');
GoTrueClient._setTokenRefreshTimer (gotrue_client.dart:552) GoTrueClient._callRefreshToken (gotrue_client.dart:606)

Maybe this is expected when a short expiration time is set, and the internet connection not reliable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth This issue or pull request is related to authentication enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants