Fixed some loading problems with loaded user and ajusted the Email allowed length (to 255)

This commit is contained in:
Dave Mc Nicoll 2022-10-10 14:27:55 +00:00
parent 374b056754
commit 267fe5cadd
2 changed files with 3 additions and 3 deletions

View File

@ -22,7 +22,7 @@ class User {
public ? string $lastName;
/**
* @Field("size" => 150)
* @Field("size" => 255)
*/
public string $email;

View File

@ -35,8 +35,8 @@ class Authenticate {
public function rememberMe(\Ulmus\Repository $repository) : ? User
{
$logUser = function(int $id) use ($repository) {
if ( null === ( $user = $repository->loadFromPk($id) ) ) {
$logUser = function(? int $id) use ($repository) {
if ( $id === null || null === ( $user = $repository->loadFromPk($id) ) ) {
throw new \Exception("User not found.");
}