Supabase Auth with token refresh #29517
Unanswered
isabelleilyia
asked this question in
Questions
Replies: 1 comment
-
if i'm reading your code correctly, your code in (2.) is part of your content script? If so, your issue is happening because the content script reloads after you close your laptop and reopen it. So you lose the entire session. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey everyone! I'm using Supabase Auth in my Chrome extension (built in React). I'm trying to get token refresh to be as consistent as possible, but the behavior has been quite inconsistent and I can't seem to pinpoint why. Here is my current setup:
useClient
fromsupabase-js
library. I initialize it once and always return this Singleton. I initalize it with the following options:AuthContext
that is initialized with theonAuthStateChange
supabase listener:I can see in the console logs that the refresh is happening. However, if I close my laptop overnight, the next day it'll say the user needs to log in again. I'm wondering if this might have something to do with the app reinitializing/supabase client reinitializing? Is there anything that looks wrong in the code?
Thanks for the help :)
Beta Was this translation helpful? Give feedback.
All reactions