Skip to content

Commit b12f8b5

Browse files
authored
feat: don't allow to emit otp when user isn't active (#79)
* feat: don't allow to emit otp when user isn't active Signed-off-by: romanetar <roman_ag@hotmail.com> * fix: user not active validation message tweak Signed-off-by: romanetar <roman_ag@hotmail.com> --------- Signed-off-by: romanetar <roman_ag@hotmail.com>
1 parent 8d6c4f4 commit b12f8b5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

app/Http/Controllers/UserController.php

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

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

307312
// check if we have a former oauth2 request

0 commit comments

Comments
 (0)