You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How do we reliably refresh tokens once they've expired?
Once my token expires, my client receives the error of expiring JWT, to which then I call supabase.auth.refreshSession() in my error block but this does not seem to work. I end up with an infinite loop where my client keeps trying to make the supabase request, receiving the JWT error, then my client calling supabase.auth.refreshSession(), etc. I soon get a rate limit error.
This appears identical to the following thread, but did not work for me. Moreover, it's more of a workaround than part of a production-ready implementation.
My current workaround is to simply logout the user and redirect to auth page.
On a somewhat unrelated note, I have a supabase + firebase auth implementation and so the overall auth state of the user needs to be in sync. Firebase has unexpiring tokens so this helps quite a bit.
Thanks in advance; really hope there is a standard/robust approach here
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
How do we reliably refresh tokens once they've expired?
Once my token expires, my client receives the error of expiring JWT, to which then I call
supabase.auth.refreshSession()
in my error block but this does not seem to work. I end up with an infinite loop where my client keeps trying to make the supabase request, receiving the JWT error, then my client callingsupabase.auth.refreshSession()
, etc. I soon get a rate limit error.This appears identical to the following thread, but did not work for me. Moreover, it's more of a workaround than part of a production-ready implementation.
My current workaround is to simply logout the user and redirect to auth page.
On a somewhat unrelated note, I have a supabase + firebase auth implementation and so the overall auth state of the user needs to be in sync. Firebase has unexpiring tokens so this helps quite a bit.
Thanks in advance; really hope there is a standard/robust approach here
Beta Was this translation helpful? Give feedback.
All reactions