Resolve validation error appearing when unrelated issue occurs
This commit is contained in:
1 parent
92705c04dc
commit
07cc0ef272
1 file changed
+5
-3
@@ -319,10 +319,12 @@ const Login = () => {
|
|||||||
body: "Welcome back! You're successfully logged in.",
|
body: "Welcome back! You're successfully logged in.",
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
setErrors({
|
|
||||||
password: "The password you provided does not match our records",
|
|
||||||
});
|
|
||||||
if (action.payload) {
|
if (action.payload) {
|
||||||
|
if (action.payload.msg === "Incorrect password")
|
||||||
|
setErrors({
|
||||||
|
password:
|
||||||
|
"The password you provided does not match our records",
|
||||||
|
});
|
||||||
// dispatch errors
|
// dispatch errors
|
||||||
createToast({
|
createToast({
|
||||||
body: action.payload.msg,
|
body: action.payload.msg,
|
||||||
|
|||||||
Reference in new issue
Block a user