-
-
Notifications
You must be signed in to change notification settings - Fork 170
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 on does supabase client does not work #563
Comments
I'm hoping to utilize
|
You need local storage support for refresh token to work... pretty sure. |
My
But when I add the |
@uze Can you send us a log / trace of the |
@uze Is this still relevant? |
Duplicate of #620 |
I am also having the issue with AsyncStorage. I can create a supabase client in expo just fine, but sessions aren't stored. As soon as I add |
This issue still valid for me: export const supabase_c = createClient(SUPABASE_PROJECT_URL, SUPABASE_KEY, {
auth: {
storage: new LargeSecureStore(),
autoRefreshToken: true,
persistSession: true,
detectSessionInUrl: false,
},
});
//Also I tried:
supabase_c.auth.refreshSession().then((res)=>{
console.log("REFRESH SESSION",res)
}).catch((error)=>{
console.log("ERROR REFRESH SESSION",error)
}) Nothing is working. AutoRefreshToken:true not work, neither refreshSession(). My "solution" right now is set the token to 5 days and logout the user by that time |
Have you tried using supabase.auth.startAutoRefresh()? I'm reading through the docs as I organize tools ahead of the start of my project, and this is something I noticed. |
Bug report
autoRefreshToken does not refresh users access_token / JWT when it expires.
Describe the bug
I'm currently working on a react native application and I sometimes keep it open for long period on one screen, but whenever I click to a new screen and a request is made to supabase I get a 401 from the request along with "JWT Expired" message. How should I properly handle the JWT for long app sessions where people typically dont log in / out all the time.
To Reproduce
Set JWT expiry limit to 60s.
Start user session and make a supabase call where the users access_token is needed. For example:
Expected behavior
When making another call the autoRefreshToken should automatically refresh the token if it is invalid.
System information
Additional context
Related issue:
The text was updated successfully, but these errors were encountered: