-
-
Notifications
You must be signed in to change notification settings - Fork 167
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
autoRefreshToken doesn't work #620
Comments
hey @nuurcodes thanks for the issue, could you please test if you can reproduce with the latest supabase-js version v1.13.1 |
@awalias Setting the JWT expiry to anything less than 60 still causes the accessToken to update in a loop on v1.13.1 When I set the JWT expiry to 60, I was expecting the accessToken to automatically update every 60 seconds but it doesn't. I've tried logging |
Having the same issue here. I'm constantly needing to log back into my app, even though I've set the expiration date to be a week long and have If |
Shouldn't this be on by default? https://github.com/supabase/supabase-js/blob/master/src/SupabaseClient.ts#L11-L12 I still see this issue on 1.15.0. |
fix: supabase/supabase-js#178 handle JWT expiry <= 60s
🎉 This issue has been resolved in version 1.15.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Sorry to dig out an old issue, but are we sure this is fixed? Despite initializing the Supabase client with There isn't much documentation on how |
How you catch session expires and and initiate supabase.auth.refreshSession() manually. Thanks |
Yeah this seems to still be happening, at least when running Supabase locally for development, working on a React Native app using Expo ->
Trying to figure out how long before it expires, and |
Can confirm this is also happening for me. |
Hey everyone, we're investigating this issue and it would be great if yall can provide the supabase-js / gotrue-js versions that you experience this error on. |
Version: |
Experiencing this with these versions: supabase-js: 2.10.0 UPDATE: For my case, I have found that the problem actually comes from nuxt-supabase: |
When I left the app running on the iOS simulator for a while and reloaded Metro, I encountered the error @supabase/supabase-js: "^2.22.0" |
I am also getting "Invalid Refresh Token: Already Used" I don't see previous invocations which might have used the token. |
Also getting this in my RN project, constantly being signed out in a matter of minutes, anything we can do here? |
Have you tried setting the jwt_expiry = 604800 |
Hey everyone, i'm attempt to reproduce this issue using the expo user management example (https://github.com/supabase/supabase/tree/master/examples/user-management/expo-user-management) but i haven't been able to reproduce this. It would be great if someone has a repo to share or can outline the reproducible steps. I'm running on export const supabase = createClient(supabaseUrl, supabaseAnonKey, {
auth: {
storage: ExpoSecureStoreAdapter as any,
autoRefreshToken: true,
persistSession: true,
detectSessionInUrl: false,
},
}); |
This response describes the issue pretty similarly to me – I'm running supabase locally using I have a cc @lewisd1996 @b2m9 @edgarsilva @uze for your repro cases? |
fwiw, the refresh token that is the session with the expired jwt is still valid according to my local db. i looked this up using the |
We're also getting the Refresh Token: Refresh Token Not Found issue every time we try to refresh. |
The issue was resolved after I updated the Supabase Nuxt package to ^0.3.1. Additionally, I had to clear my existing Supabase cookies, which allowed the functionality to work as intended. |
Only way I am able to resolve this issue is uninstalling the app and installing it again. This occurs in local development and not in production. Using React native with @supabase/supabase-js: ^2.37.0 |
Same happening for me. Here my supabase client setup:
Plus this one for handling foreground / background handling but even with or without no difference:
Majorly I dont see any events or tries of refreshing the token. Moreover default 1 hour of course stays longer logged in but setting 50, 60 or 120 seconds mostly logs me out after good 20 seconds. |
I'm getting the same thing. To reproduce more easily, I set the token to 10 seconds.
Here is the traceback:
I turned on auth: {debug: true}, will see if I can catch another one. |
Ok, I think I know what's going on, at least in my case. There is a race condition between the check for the session expiration and when the session is used to get the user:
If the session is expiring in the new milliseconds, this causes the exception. I think an easy workaround would be to add an arbitrary or configurable offset to the session expiration check and refresh a session that expires very soon. |
Bug report
Describe the bug
After initialising supabase client with
and setting the JWT expiry to 60 (seconds) on the supabase dashboard, the token does not refresh after 60 seconds have elapsed. Oddly enough, setting the JWT expiry to anything less than 60 triggers the token refresh but it constantly updates without waiting for expiry
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
Expected behavior
The token should refresh after the expiry time set on the supabase dashboard
System information
The text was updated successfully, but these errors were encountered: