Skip to content

Commit 55815ec

Browse files
committed
feat: don't allow to emit otp when user isn't active
Signed-off-by: romanetar <roman_ag@hotmail.com>
1 parent 5fa22d1 commit 55815ec

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

app/Http/Controllers/UserController.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,11 @@ public function emitOTP()
303303
throw new ValidationException("empty username.");
304304
}
305305

306+
$user = $this->auth_service->getUserByUsername($username);
307+
308+
if (!$user->isActive())
309+
throw new ValidationException("user is not active.");
310+
306311
$client = null;
307312

308313
// check if we have a former oauth2 request

0 commit comments

Comments
 (0)