rphlmr / supa-fly-stack

The Remix Stack for deploying to Fly with Supabase, authentication, testing, linting, formatting, etc.
MIT License
289 stars 26 forks source link

Fix : memo supabase client to preserve oauth url state parsing when ssr #44

Closed rphlmr closed 1 year ago

rphlmr commented 1 year ago

Since I made Supabase client a "request scope" client, sometimes OAuth stop working (strangely, only in Firefox). With SSR, React process 2 times : one on server and one on browser. Supabase client listener is unsubscribed when useEffect unmounts on server side, and it doesn't listen again when re-run client side (hard time to debug that :D). Client side, we can reuse the same client, it's safe.