Changed logincheck type and error clarification

This commit is contained in:
Peter KW 2024-03-17 19:38:51 +01:00
parent 1977125923
commit 888256e9f6

View file

@ -10,7 +10,7 @@ function LoginCheck(props: {
username: string; username: string;
password: string; password: string;
setAuthority: Dispatch<SetStateAction<number>>; setAuthority: Dispatch<SetStateAction<number>>;
}): number { }): void {
const user: NewUser = { const user: NewUser = {
username: props.username, username: props.username,
password: props.password, password: props.password,
@ -42,14 +42,12 @@ function LoginCheck(props: {
console.error("Token was undefined"); console.error("Token was undefined");
} }
} else { } else {
console.error("Token could not be fetched"); console.error("Token could not be fetched/No such user");
} }
}) })
.catch((error) => { .catch((error) => {
console.error("An error occurred during login:", error); console.error("An error occurred during login:", error);
}); });
return 0;
} }
export default LoginCheck; export default LoginCheck;