Some "wrong login" alerts
This commit is contained in:
parent
0d4d77633d
commit
385ceba248
1 changed files with 5 additions and 0 deletions
|
@ -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) => {
|
||||||
|
|
Loading…
Reference in a new issue