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
Syuks
SyuksOP4mo ago
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.
Alejandro Montes
Have you been able to solve this? I'm having the same issue of full page reload on signup.
Syuks
SyuksOP3mo ago
Read my comment before yours
deegii
deegii2mo ago
how did you solve that

Did you find this page helpful?