From cb5434d166b9d60c50a56645be5cf2cdcdc07359 Mon Sep 17 00:00:00 2001 From: Tiago Ribeiro Date: Mon, 25 Sep 2023 11:37:50 +0100 Subject: [PATCH] Added a "trim" to the verification --- src/pages/action.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pages/action.tsx b/src/pages/action.tsx index 67bdc546..981cf83b 100644 --- a/src/pages/action.tsx +++ b/src/pages/action.tsx @@ -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) => { @@ -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; }