From 07cc0ef272377f931d7f71b4e398c378f573077a Mon Sep 17 00:00:00 2001 From: Daniel Cojocea Date: Fri, 16 Aug 2024 16:30:49 -0400 Subject: [PATCH] Resolve validation error appearing when unrelated issue occurs --- Client/src/Pages/Auth/Login.jsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Client/src/Pages/Auth/Login.jsx b/Client/src/Pages/Auth/Login.jsx index ad5fcdbce..84f6c518e 100644 --- a/Client/src/Pages/Auth/Login.jsx +++ b/Client/src/Pages/Auth/Login.jsx @@ -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,