Permet l'inscription d'utilisateurs

This commit is contained in:
2022-11-30 11:21:48 +01:00
parent 1bce756470
commit d6a3a7938a
7 changed files with 81 additions and 5 deletions

View File

@@ -45,4 +45,14 @@ class Security
}
return $this->user;
}
public function register(User $user): ?User
{
if (!$this->userGateway->insert($user)) {
return null;
}
$this->session[USER] = $user->getId();
$this->user = $user;
return $user;
}
}