diff --git a/frontend/src/pages/login.tsx b/frontend/src/pages/login.tsx index e68c276..5781aad 100644 --- a/frontend/src/pages/login.tsx +++ b/frontend/src/pages/login.tsx @@ -32,10 +32,20 @@ const LoginPageWithRouter = withRouter( private passwordRef: any = undefined; performLogin = () => { - this.props.setLoading(true); - + // Check if the inputs are even valid const username = this.usernameRef.value || ""; const password = this.passwordRef.value || ""; + if (!username) { + this.props.setSnackbar(true, "Ungültiger Nutzername"); + return; + } + if (!password) { + this.props.setSnackbar(true, "Ungültiges Passwort"); + return; + } + + this.props.setLoading(true); + this.props.login(username, password).then((res: IUser) => { // Stop the loading animation this.props.setLoading(false);