Skip to content

Commit 9f80887

Browse files
committed
fix: remove otp settings for service account app types
Signed-off-by: romanetar <roman_ag@hotmail.com>
1 parent 5d5b218 commit 9f80887

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

app/Models/OAuth2/Client.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1673,11 +1673,13 @@ public function isPasswordlessEnabled(): bool
16731673

16741674
public function enablePasswordless(): void
16751675
{
1676-
if (in_array($this->getApplicationType(), self::$allowed_otp_client_types)) {
1677-
$this->otp_enabled = true;
1678-
$this->otp_length = intval(Config::get("otp.length"));
1679-
$this->otp_lifetime = intval(Config::get("otp.lifetime"));
1676+
$app_type = $this->getApplicationType();
1677+
if (!in_array($this->getApplicationType(), self::$allowed_otp_client_types)) {
1678+
throw new ValidationException("This application type ($app_type) does not allow passwordless.");
16801679
}
1680+
$this->otp_enabled = true;
1681+
$this->otp_length = intval(Config::get("otp.length"));
1682+
$this->otp_lifetime = intval(Config::get("otp.lifetime"));
16811683
}
16821684

16831685
public function disablePasswordless(): void

0 commit comments

Comments
 (0)