Replies: 6 comments 10 replies
-
This looked interesting so I tried figuring it out. Supabase uses GoTrue for the auth, so it's just calling GoTrue api endpoints. One of which is Try calling Here's how supabase's signUp function calls api.signUpWithEmail: https://github.com/supabase/gotrue-js/blob/5d2f65a3d8b565b47e277211e6a4c8054c0b8e97/src/GoTrueClient.ts#L123. And you can see how it saves the session too. If Supabase does want to implement this feature (or from a pull request) then I think it could easily be done by adding a |
Beta Was this translation helpful? Give feedback.
-
Hi! 👋 I stumbled upon a similar issue. Using @mozeryansky advice of using |
Beta Was this translation helpful? Give feedback.
-
Any updates on this? |
Beta Was this translation helpful? Give feedback.
-
I think with |
Beta Was this translation helpful? Give feedback.
-
I was able to keep my session, but in a very hacky way: // First you have to obtain the current session
const { data: currentSession } = await supabase.auth.getSession();
// Then, you sign up the user
const { error: authError } = await supabase.auth.signUp({
email,
password,
});
// Finally, you set the previous session manually
supabase.auth.setSession(currentSession.session!); Hope this helps someone. |
Beta Was this translation helpful? Give feedback.
-
For anyone stumbled upon missing |
Beta Was this translation helpful? Give feedback.
-
I am using exact same code from here https://ruanmartinelli.com/posts/supabase-authentication-react but problem is when user sign up happens then user should be navigated to login page but instead user session is generated and it gets automatically logged in. I don't want user to be able to view private routes if sign up is success only show private route if login is success. How can I do that?
Beta Was this translation helpful? Give feedback.
All reactions