diff --git a/webseite/login.php b/webseite/login.php index b1f8cf2..666a787 100644 --- a/webseite/login.php +++ b/webseite/login.php @@ -12,7 +12,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') { // Try to retrieve the user from the username $user = User::getFromUsername($username); - if ($user->login($password)) { + if ($user && $user->login($password)) { // Redirect to a protected page if login is successful header("Location: index.php?login=success");