Closed bytechase closed 1 year ago
I was going to use this project but it seems problematic.
Could be probably fixed like here? https://github.com/supabase/supabase/pull/13645
https://github.com/vercel/nextjs-subscription-payments/blob/main/app/supabase-provider.tsx#L27
Curious, why do we need the client-side Provider component at all with /app directory and RSC? Would it be possible to go without it?
EDIT:
Couldn't the supabase-provider.tsx
be replaced by middleware that manages session changes?
There seems to be a bug caused on when the supabase provider received an "INITIAL_SESSION" event from supabase.auth.onAuthStateChange. This is causing an infinite refresh loop. I also don't see any documentation of the supabase auth events to have an "INITIAL_SESSION"