redwoodjs / redwood

The App Framework for Startups
https://redwoodjs.com
MIT License
17.28k stars 991 forks source link

Supabase auth always overwrites the window location during restoreAuth #9549

Open KrisCoulson opened 11 months ago

KrisCoulson commented 11 months ago

This line below always overwrites the window location any time a redwood app loads. It is meant to handle refreshing the auth tokens. The issue is this completely wipes out search params on page load even if they are unrelated to supabase authentication.

https://github.com/redwoodjs/redwood/blob/43227f3b66a66c304ac2dbe513024a3ebc1ae145/packages/auth-providers/supabase/web/src/supabase.ts#L208-L212

It always gets called because this useEffect calls restoreAuth.

https://github.com/redwoodjs/redwood/blob/43227f3b66a66c304ac2dbe513024a3ebc1ae145/packages/auth/src/AuthProvider/AuthProvider.tsx#L130-L138

Tobbe commented 11 months ago

Thanks @KrisCoulson. Do you want to take a look at fixing it? No pressure, just let me know 🙂

KrisCoulson commented 11 months ago

Yeah @Tobbe I can take a look at this. I self assigned. Not 100% sure when I can get to it ATM but I just wanted to get it documented here.

Tobbe commented 11 months ago

Yeah, no rush, and thank you! 🙏