Resolve validation error appearing when unrelated issue occurs

This commit is contained in:
Daniel Cojocea
2024-08-16 16:30:49 -04:00
parent 92705c04dc
commit 07cc0ef272

View File

@@ -319,10 +319,12 @@ const Login = () => {
body: "Welcome back! You're successfully logged in.",
});
} else {
setErrors({
password: "The password you provided does not match our records",
});
if (action.payload) {
if (action.payload.msg === "Incorrect password")
setErrors({
password:
"The password you provided does not match our records",
});
// dispatch errors
createToast({
body: action.payload.msg,