saeris
02/04/2022, 8:55 AMhttp://localhost:3000/#, when in my code I've set my redirect options as follows for my signIn hook:
await signIn(
{
provider: `discord`
},
{
redirectTo: `http://localhost:3000/dashboard`
}
);
Any ideas?saeris
02/04/2022, 8:57 AMsaeris
02/04/2022, 9:01 AM_app to subscribe to auth change events and update the session cookie via an auth api endpointadrian_h
02/04/2022, 7:27 PMsaeris
02/04/2022, 10:58 PMsaeris
02/04/2022, 11:05 PMreact-supabase source files, wrapped my _app in the context provider, and I have an auth api route that calls setAuthCookie(), which should be invoked every time onAuthStateChange() triggers in my _app.saeris
02/04/2022, 11:07 PMgetServerSideProps function which calls getUserByCookie, which handles the redirect logic. I have no issue navigating to the dashboard route after I've logged in, it's just the redirect on login success that takes me to the wrong place it seemssaeris
02/04/2022, 11:08 PMsaeris
02/04/2022, 11:10 PMsaeris
02/04/2022, 11:14 PMgetUserByCookie failssaeris
02/04/2022, 11:46 PMSIGNED_IN event doesn't fire until I get bounded from dashboard and redirected to the home route, because the call to the auth api isn't made until _app renders the page. So somewhere in the getServerSideProps I think I need to be handling the SIGNED_IN event somehowsaeris
02/04/2022, 11:46 PMsaeris
02/04/2022, 11:53 PMredirectTo in the signIn call and instead manually redirect using next router in _app when a SIGNED_IN event happens. The problem here is that you basically hit the home route first before being redirected again to dashboardsaeris
02/05/2022, 6:58 PMsaeris
02/05/2022, 7:00 PM