transition

This commit is contained in:
lexx committed 2024-08-14 22:04:34 +03:00
1 parent 1ab3f678b7
commit 1f3ebafe69
50 files changed
+924 -172

No files matched your search

+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(