Implementing the Reset Page #13

Merged
ameye merged 1 commits from implement-reset-password-pages into master 2023-04-25 08:34:17 +00:00
2 changed files with 9 additions and 7 deletions
+3 -1
View File
@@ -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
@@ -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("")
}