From efc7956e0d4530e02bd963fde8afa08b0eff8ec8 Mon Sep 17 00:00:00 2001 From: emmanueposu Date: Thu, 30 May 2024 03:23:35 -0700 Subject: [PATCH] Fixed issue where user can log in with invalid credentials --- trivia-forge/frontend/src/Pages/LoginPage.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trivia-forge/frontend/src/Pages/LoginPage.jsx b/trivia-forge/frontend/src/Pages/LoginPage.jsx index 64c97b7..79f2ce8 100644 --- a/trivia-forge/frontend/src/Pages/LoginPage.jsx +++ b/trivia-forge/frontend/src/Pages/LoginPage.jsx @@ -18,7 +18,7 @@ function LoginPage() { // call getUser function to validate user credentials const user = await getUser(email, password); // user doesn't exist - if (!user) { + if (user.error !== undefined) { alert('Error logging in: Invalid email or password'); return; }