diff --git a/src/Routers.jsx b/src/Routers.jsx
index 061a28d..ca6ebcc 100644
--- a/src/Routers.jsx
+++ b/src/Routers.jsx
@@ -50,7 +50,7 @@ export default function Routers() {
element={}
/>
} />
- } />
+ } />
{/* private route */}
}>
diff --git a/src/components/AuthPages/ForgotPassword/index.jsx b/src/components/AuthPages/ForgotPassword/index.jsx
index 589d446..65bdbe7 100644
--- a/src/components/AuthPages/ForgotPassword/index.jsx
+++ b/src/components/AuthPages/ForgotPassword/index.jsx
@@ -11,6 +11,7 @@ export default function ForgotPassword() {
// email
const [email, setMail] = useState("");
const [msgError, setMsgError] = useState('');
+ const [msgSuccess, setMsgSuccess] = useState(false)
const navigate = useNavigate();
const userApi = new usersService();
@@ -20,8 +21,8 @@ export default function ForgotPassword() {
};
const humanChecker = () => {
- setValue(!checked);
- };
+ setValue(!checked)
+ }
const resetHandler = async () => {
if (email == '') {
@@ -30,24 +31,16 @@ export default function ForgotPassword() {
setMsgError('Check if you are human')
}
- if (email != '' && checked) {
+ if (email !== '' && checked) {
const reqData = { email }
setResetLoading(true)
try {
const res = await userApi.StartResetPassword(reqData)
if (res.status === 200) {
- const { data } = res
- if (data.status == -1) {
- setMsgError('This is an incorrect or duplicate email')
- setResetLoading(false)
- } else if (data.status > 0) {
- setResetLoading(false)
- navigate("/verify-you", { replace: true })
- } else{
- setMsgError("reset was not successful")
- setResetLoading(false)
- }
+ setMsgSuccess(true)
setMail("")
+ setValue(false)
+ setResetLoading(false)
}
} catch (error) {
setResetLoading(false)
@@ -79,12 +72,10 @@ export default function ForgotPassword() {
-
+
Forget Password
- Enter your email to reset your password.
+ Enter your email to reset your password.
@@ -98,7 +89,6 @@ export default function ForgotPassword() {
iconName="message"
/>
- {msgError &&
{msgError}
}
{/* hCaptha clone for the time being */}
@@ -108,7 +98,7 @@ export default function ForgotPassword() {
@@ -126,12 +116,15 @@ export default function ForgotPassword() {
+ {msgError &&
{msgError}
}
+ {msgSuccess &&
If we find your email, you will receive a link to reset your password. Please use or contact form if you did not get our message after few minutes.
}
+