From 932b692fa3c838fb3157bfa0bc903d7d34002d86 Mon Sep 17 00:00:00 2001 From: Max Hakansson Date: Thu, 4 Apr 2024 17:19:41 -0400 Subject: [PATCH] Hide loading screen if you don't enter valid credentials --- src/frontend/pages/login/index.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/frontend/pages/login/index.tsx b/src/frontend/pages/login/index.tsx index a4b2c1ca62..f1d2373e4c 100644 --- a/src/frontend/pages/login/index.tsx +++ b/src/frontend/pages/login/index.tsx @@ -25,21 +25,25 @@ const Login: NextPage = () => { // Check if the user has entered both fields correctly if ("" === email) { setEmailError("Please enter your email"); + setLoginProcessing(false); return; } if (!/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(email)) { setEmailError("Please enter a valid email"); + setLoginProcessing(false); return; } if ("" === password) { setPasswordError("Please enter a password"); + setLoginProcessing(false); return; } if (password.length < 7) { setPasswordError("The password must be 8 characters or longer"); + setLoginProcessing(false); return; }