From 385ceba248670076aa67f50234b6fb01bbb5b724 Mon Sep 17 00:00:00 2001 From: Peter KW Date: Thu, 11 Apr 2024 00:35:25 +0200 Subject: [PATCH] Some "wrong login" alerts --- frontend/src/Components/LoginCheck.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/src/Components/LoginCheck.tsx b/frontend/src/Components/LoginCheck.tsx index f44d7f3..752c2dc 100644 --- a/frontend/src/Components/LoginCheck.tsx +++ b/frontend/src/Components/LoginCheck.tsx @@ -11,6 +11,10 @@ function LoginCheck(props: { password: string; setAuthority: Dispatch>; }): void { + if (props.username === "" || props.password === "") { + alert("Please enter username and password to login"); + return; + } const user: NewUser = { username: props.username, password: props.password, @@ -43,6 +47,7 @@ function LoginCheck(props: { } } else { console.error("Token could not be fetched/No such user"); + alert("Could not login, wrong username or password"); } }) .catch((error) => {