transition
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user