From c45815d4378d1a429c25896ba3010c5a18c7da84 Mon Sep 17 00:00:00 2001 From: Ebube Date: Tue, 25 Apr 2023 08:44:49 +0100 Subject: [PATCH] Made time lesser --- .env | 4 +++- src/components/AuthPages/ForgotPassword/index.jsx | 12 ++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.env b/.env index 26a2207..f58ba9f 100644 --- a/.env +++ b/.env @@ -22,7 +22,9 @@ REACT_APP_SESSION_EXPIRE_CHECKER=60000 REACT_APP_LOGIN_ERROR_TIMEOUT=7000 REACT_APP_SIGNUP_ERROR_TIMEOUT=7000 -REACT_APP_RESET_START_ERROR_TIMEOUT=5000 + +# Had to change the error time to 3sec cause it took too long +REACT_APP_RESET_START_ERROR_TIMEOUT=3000 #apigate.lotus.g1.wrenchboard.com:76.209.103.227 #apigate.orion.g1.wrenchboard.com:76.209.103.227 diff --git a/src/components/AuthPages/ForgotPassword/index.jsx b/src/components/AuthPages/ForgotPassword/index.jsx index 8bf29a2..589d446 100644 --- a/src/components/AuthPages/ForgotPassword/index.jsx +++ b/src/components/AuthPages/ForgotPassword/index.jsx @@ -25,7 +25,7 @@ export default function ForgotPassword() { const resetHandler = async () => { if (email == '') { - setMsgError('Please fill in fields') + setMsgError('An email is required') } else if (!checked) { setMsgError('Check if you are human') } @@ -38,14 +38,14 @@ export default function ForgotPassword() { if (res.status === 200) { const { data } = res if (data.status == -1) { - setMsgError('reset was not successful') + setMsgError('This is an incorrect or duplicate email') setResetLoading(false) - return - } - if (data.status > 0) { + } else if (data.status > 0) { setResetLoading(false) navigate("/verify-you", { replace: true }) - console.log('Success', data) + } else{ + setMsgError("reset was not successful") + setResetLoading(false) } setMail("") } -- 2.34.1