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

fix: supabase/supabase-js#178 handle JWT expiry <= 60s #101

Merged
merged 1 commit into from
Jun 14, 2021
Merged

fix: supabase/supabase-js#178 handle JWT expiry <= 60s #101

merged 1 commit into from
Jun 14, 2021

Conversation

thebengeu
Copy link
Member

What kind of change does this PR introduce?

Handles JWT expiry <= 60s correctly.

What is the current behavior?

#620: Refresh token doesn't update when JWT expiry is set to 60, constantly updates when JWT expiry is set to less than 60 since expiresAt - timeNow - 60 is negative.

What is the new behavior?

When JWT expiry is set to more than 60, current behavior remains to refresh 60s before expiry. When JWT expiry is set to 60 or less, new behavior is to refresh 0.5s before expiry.

Additional context

0.5s is chosen to support JWT expiry of 1s, even though that should be an edge case. That should usually still be enough time to reach the server before expiry.

@awalias
Copy link
Member

awalias commented Jun 14, 2021

on fire @thebengeu 🔥

@awalias
Copy link
Member

awalias commented Jun 14, 2021

@thebengeu
Copy link
Member Author

Fixed.

@kiwicopple
Copy link
Member

legend, thanks @thebengeu

@kiwicopple kiwicopple merged commit c2a1975 into supabase:master Jun 14, 2021
@github-actions
Copy link
Contributor

🎉 This PR is included in version 1.16.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants