Some "wrong login" alerts

This commit is contained in:
Peter KW 2024-04-11 00:35:25 +02:00
parent 0d4d77633d
commit 385ceba248

View file

@ -11,6 +11,10 @@ function LoginCheck(props: {
password: string; password: string;
setAuthority: Dispatch<SetStateAction<number>>; setAuthority: Dispatch<SetStateAction<number>>;
}): void { }): void {
if (props.username === "" || props.password === "") {
alert("Please enter username and password to login");
return;
}
const user: NewUser = { const user: NewUser = {
username: props.username, username: props.username,
password: props.password, password: props.password,
@ -43,6 +47,7 @@ function LoginCheck(props: {
} }
} else { } else {
console.error("Token could not be fetched/No such user"); console.error("Token could not be fetched/No such user");
alert("Could not login, wrong username or password");
} }
}) })
.catch((error) => { .catch((error) => {