diff --git a/apps/app/components/account/email-code-form.tsx b/apps/app/components/account/email-code-form.tsx index e150a639f..db201041c 100644 --- a/apps/app/components/account/email-code-form.tsx +++ b/apps/app/components/account/email-code-form.tsx @@ -70,11 +70,10 @@ export const EmailCodeForm = ({ onSuccess }: any) => { onSuccess(response); }) .catch((error) => { - console.log(error); setToastAlert({ title: "Oops!", type: "error", - message: "Enter the correct code to sign in", + message: error?.response?.data?.error ?? "Enter the correct code to sign in", }); setError("token" as keyof EmailCodeFormValues, { type: "manual", diff --git a/apps/app/pages/signin.tsx b/apps/app/pages/signin.tsx index 968a47d8e..fff701679 100644 --- a/apps/app/pages/signin.tsx +++ b/apps/app/pages/signin.tsx @@ -35,10 +35,11 @@ const SignInPage: NextPage = () => { const { setToastAlert } = useToast(); const onSignInSuccess = useCallback(async () => { + setLoading(true); await mutateUser(); const nextLocation = router.asPath.split("?next=")[1]; - if (nextLocation) router.push(nextLocation as string); - else router.push("/"); + if (nextLocation) await router.push(nextLocation as string); + else await router.push("/"); }, [mutateUser, router]); const handleGoogleSignIn = ({ clientId, credential }: any) => {