validation für login

This commit is contained in:
Illia Hromovoi 2025-07-03 11:58:58 +02:00
parent fdb02b051c
commit bdc491fbfa

View File

@ -120,8 +120,13 @@ class UserController{
public function login(){
$user = $this->db->getUserByEmail($_POST["email"]);
$this->validateLoginForm();
if(!$user){
echo "Benutzer nicht gefunden";
$this->loginErrors['email'] = "Email oder Passwort ist falsch";
$this->view->setDoMethodName("showUserLoginForm");
$this->showUserLoginForm();
return;
}
$hash = hash('sha256', $_POST["password"] . $user["salt"]);