Added a "trim" to the verification
This commit is contained in:
@@ -52,14 +52,14 @@ export default function Reset({code, mode, apiKey, continueUrl}: {code: string;
|
||||
axios
|
||||
.post<{ok: boolean}>("/api/reset/verify", {
|
||||
link: `https://encoach.com/action?apiKey=${apiKey}&mode=${mode}&oobCode=${code}&continueUrl=${continueUrl}`,
|
||||
email,
|
||||
email: email?.trim(),
|
||||
})
|
||||
.then((response) => {
|
||||
if (response.data.ok) {
|
||||
toast.success("Your account has been verified!", {toastId: "verify-successful"});
|
||||
setTimeout(() => {
|
||||
router.push("/");
|
||||
}, 2000);
|
||||
}, 1000);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -71,8 +71,8 @@ export default function Reset({code, mode, apiKey, continueUrl}: {code: string;
|
||||
toast.error("Something went wrong! Please make sure to click the link in your e-mail again and input the correct e-mail!", {
|
||||
toastId: "verify-error",
|
||||
});
|
||||
})
|
||||
.finally(() => setIsLoading(false));
|
||||
setIsLoading(false);
|
||||
});
|
||||
};
|
||||
|
||||
const login = (e: FormEvent<HTMLFormElement>) => {
|
||||
@@ -86,7 +86,7 @@ export default function Reset({code, mode, apiKey, continueUrl}: {code: string;
|
||||
toast.success("Your password has been reset!", {toastId: "reset-successful"});
|
||||
setTimeout(() => {
|
||||
router.push("/login");
|
||||
}, 2000);
|
||||
}, 1000);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user