added other stages

This commit is contained in:
Chukwumdiebube
2023-03-02 21:36:19 +01:00
parent 32efae78ea
commit e574f6d49d
6 changed files with 232 additions and 37 deletions
@@ -20,11 +20,10 @@ export default function ForgotPassword() {
function validationChecker(email) {
const emailCheck = /^[^0-9][a-zA-Z0-9._%+-]+@[a-zA-Z]+(\.[a-zA-Z]+)+$/;
if (email === "") {
setValidation("email is required");
setValidation("");
} else if (!email.match(emailCheck)) {
setValidation('Please input a valid email address');
} else {
setValidation("");
setButtonDisabled(false)
}
}
@@ -36,6 +35,10 @@ export default function ForgotPassword() {
}
const reset = await user.resetPassword(resetEmail);
setLoading(true)
const {raw_data, uuid} = reset.data
localStorage.setItem('reset_uuid', uuid)
localStorage.setItem('reset_raw', JSON.stringify(raw_data))
if (reset.status == 200){
setTimeout(() => {
navigate("/verify-you", {replace : true});