electron auth session persistence

I'm working on an electron app using nextjs and supabase auth, how do we set it up such that the user is always logged into the app when they open it? particularly, how do we ensure that the refresh token gets refreshed properly? I feel like I keep seeing it kicking me out randomly due to the refresh token getting invalidated, mainly when I reopen the app after the computer's been closed/asleep for a while. I'm storing the session tokens in electron encrypted safeStorage.
1 Reply
ihm40
ihm402mo ago
I think this section of Auth might be what you are looking for https://supabase.com/docs/reference/javascript/auth-startautorefresh
JavaScript: Start auto-refresh session (non-browser) | Supabase Docs
Supabase API reference for JavaScript: Start auto-refresh session (non-browser)

Did you find this page helpful?