React SPA redirects on signIn and signUp
In a React SPA when I call
authClient.signIn.email({email, password} my whole page does a hard reload on success. Is this intended behavior? I couldn't find the source code where this happens (yes, im preventing default in my form).
Also, when I do authClient.signUp.email({name, email, password}, {onSuccess: () => navigate({ to: "/" })}) my auth check with authClient.getSession() in my protected route always fails and I end up redirected in my sign in form. How do you guys solve this race condition?4 Replies
For the first question I found out that the culprit was the
crossDomain plugin from get-convex/better-auth and how it handles th callbackURL on signIn.
The second question is still troublesome.Have you been able to solve this? I'm having the same issue of full page reload on signup.
Read my comment before yours
how did you solve that