supabase-js v2: PKCE session lost after tab switch (persistSession + autoRefreshToken not working)
Using @supabase/supabase-js@2.52.0
PKCE flow enabled
Config: persistSession: true, autoRefreshToken: true
On tab switch → auth.getSession() returns null
Tried SessionRecoveryManager and manual refresh — still breaks silently
Expectation: session should persist across tabs and recover
Question: Is this a known bug with PKCE session persistence? Should I use a different storage adapter (localStorage, IndexedDB, custom)?"
Wasted 2 supabase projects and 2 days and have no clue what to do
1 Reply
You've not provided any code. In the meantime, you can take a look at this example repo for PKCE flow https://github.com/silentworks/supabase-by-example/tree/main/nextjs