https://supabase.com/ logo
I'm running into a peculiar problem. - I'm using...
# help
k
I'm running into a peculiar problem. - I'm using
onAuthStateChange
to set an auth cookie - I'm checking for the cookie in an edge function to guard protected routes
/dashboard
- After signing up/in I redirect users to the dashboard page - Redirecting was happening before auth cookie was set, so the edge function forwarded them away - I fixed this by listening for
event === 'SIGNED_IN'
, and after auth cookie is set, I redirect to
/dashboard
- Worked great for signing in, but when a user signs up I first create the user, and then I create an additional row in another table - The user is being redirected before the additional row is created because
event === 'SIGNED_IN'
is being triggered So, is there anyway to sign up without triggering sign in? Or is there a solution to one of these problems I'm not seeing?
n
Hello @Kolby! This thread has been automatically created from your message in #843999948717555735 a few seconds ago. We have already mentioned the @User so that they can see your message and help you as soon as possible! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ``...`` menu) and select "Leave Thread" to unsubscribe from future updates. Want to change the title? Use the ``/title`` command! We have solved your problem? Click the button below to archive it.
j
Hey @Kolby what you probably want for this, is to use a postgres trigger function, to create the addition row automatically.
n
Thread was archived by @Kolby. Anyone can send a message to unarchive it.