Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions apps/app/components/account/email-code-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 3 additions & 2 deletions apps/app/pages/signin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down