transition

This commit is contained in:
2024-08-14 22:04:34 +03:00
parent 1ab3f678b7
commit 1f3ebafe69
50 changed files with 924 additions and 172 deletions
+4 -8
View File
@@ -119,24 +119,20 @@ readonly class AuthService
}
/**
* @throws LucentException
*/
public
function sendLoginEmail(string $email): void
public function sendLoginEmail(string $email): void
{
$emailAddress = (new Email($email));
$user = $this->userRepo->findByEmail($emailAddress);
if ($user->isEmpty()) {
throw new LucentException("User not found");
return;
}
if ($user->get()->isRemoved()) {
throw new LucentException("Cannot reset email if the user is not active");
return;
}
$newToken = $this->userRepo->updateLoginToken($user->get()->id);
Mail::to($email)->send(