Password bugs solved
This commit is contained in:
parent
5735016d1c
commit
eb7226a6d7
@ -84,7 +84,7 @@ const ChangePassword = () => {
|
||||
];
|
||||
|
||||
const failedRule = rules.find(r => !r.regex.test(password));
|
||||
return failedRule ? `Password must contain: ${failedRule.msg}.` : "";
|
||||
return failedRule ? `Password must meet complexity requirements.` : "";
|
||||
};
|
||||
|
||||
const handleSubmit = async (e) => {
|
||||
|
||||
@ -121,7 +121,7 @@ const PublicContactForm = () => {
|
||||
const response = await apiClient.post("/forgot-password/request-otp", payload);
|
||||
|
||||
if (response?.data) {
|
||||
showToast('success', 'OTP sent to your registered email successfully!');
|
||||
showToast('success', 'Verification Code sent to your registered email successfully!');
|
||||
setTimeout(() => {
|
||||
navigate("/change-password", {
|
||||
state: { email: formData.email.trim() },
|
||||
@ -134,7 +134,7 @@ const PublicContactForm = () => {
|
||||
const msg =
|
||||
err.response?.data?.message ||
|
||||
err.message ||
|
||||
"Failed to send OTP. Please check your details and try again.";
|
||||
"Failed to send Verification Code. Please check your details and try again.";
|
||||
setErrorMsg(msg);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
@ -161,7 +161,7 @@ const PublicContactForm = () => {
|
||||
const response = await apiClient.post("/forgot-password/verify-otp", payload);
|
||||
|
||||
if (response?.data?.status === "success") {
|
||||
setSuccess("OTP verified successfully. Redirecting to change password...");
|
||||
setSuccess("Verification Code verified successfully. Redirecting to change password...");
|
||||
setTimeout(() => navigate("/change-password"), 1500);
|
||||
} else {
|
||||
const serverMsg = response?.data?.message?.toLowerCase() || "";
|
||||
@ -190,7 +190,7 @@ const PublicContactForm = () => {
|
||||
};
|
||||
|
||||
const handleResendOtp = () => {
|
||||
setOtpMsg("A new OTP has been sent to your registered email.");
|
||||
setOtpMsg("A new Verification Code has been sent to your registered email.");
|
||||
setOtp("");
|
||||
};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user