diff --git a/app/Services/Auth/UserService.php b/app/Services/Auth/UserService.php index 4910a878..f4df159d 100644 --- a/app/Services/Auth/UserService.php +++ b/app/Services/Auth/UserService.php @@ -225,7 +225,12 @@ public function verifyEmail(string $token): User return $this->tx_service->transaction(function () use ($token) { $user = $this->user_repository->getByVerificationEmailToken($token); - if (is_null($user) || !$user->isActive()) { + if (is_null($user)) { + Log::warning("UserService::verifyEmail no user found for token"); + throw new EntityNotFoundException(); + } + + if (!$user->isActive()) { Log::warning(sprintf("UserService::verifyEmail user with id %s is not active", $user->getId())); throw new EntityNotFoundException(); } diff --git a/resources/js/login/login.js b/resources/js/login/login.js index c55a4b91..a5f0ea06 100644 --- a/resources/js/login/login.js +++ b/resources/js/login/login.js @@ -617,7 +617,7 @@ class LoginPage extends React.Component { }, function () { //Once the state is updated, it's now possible to trigger emitOtpAction. //No need to wait for the component to update. - if (!response.has_password_set) { + if (!response.has_password_set && response.is_verified !== false) { this.emitOtpAction(); } });