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
|
axios
|
||||||
.post<{ok: boolean}>("/api/reset/verify", {
|
.post<{ok: boolean}>("/api/reset/verify", {
|
||||||
link: `https://encoach.com/action?apiKey=${apiKey}&mode=${mode}&oobCode=${code}&continueUrl=${continueUrl}`,
|
link: `https://encoach.com/action?apiKey=${apiKey}&mode=${mode}&oobCode=${code}&continueUrl=${continueUrl}`,
|
||||||
email,
|
email: email?.trim(),
|
||||||
})
|
})
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
if (response.data.ok) {
|
if (response.data.ok) {
|
||||||
toast.success("Your account has been verified!", {toastId: "verify-successful"});
|
toast.success("Your account has been verified!", {toastId: "verify-successful"});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
router.push("/");
|
router.push("/");
|
||||||
}, 2000);
|
}, 1000);
|
||||||
return;
|
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!", {
|
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",
|
toastId: "verify-error",
|
||||||
});
|
});
|
||||||
})
|
setIsLoading(false);
|
||||||
.finally(() => setIsLoading(false));
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const login = (e: FormEvent<HTMLFormElement>) => {
|
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"});
|
toast.success("Your password has been reset!", {toastId: "reset-successful"});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
router.push("/login");
|
router.push("/login");
|
||||||
}, 2000);
|
}, 1000);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user