chore: run linter
This commit is contained in:
parent
e2a0c2d825
commit
0a4c62085c
1 changed files with 20 additions and 20 deletions
|
@ -3346,9 +3346,9 @@ App::post('/v1/account/mfa/:provider')
|
||||||
|
|
||||||
$backups = Provider::generateBackupCodes();
|
$backups = Provider::generateBackupCodes();
|
||||||
|
|
||||||
if ($user->getAttribute('totp') && $user->getAttribute('totpVerification')) {
|
if ($user->getAttribute('totp') && $user->getAttribute('totpVerification')) {
|
||||||
throw new Exception(Exception::GENERAL_UNKNOWN, 'TOTP already exists.');
|
throw new Exception(Exception::GENERAL_UNKNOWN, 'TOTP already exists.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$user
|
$user
|
||||||
->setAttribute('totp', true)
|
->setAttribute('totp', true)
|
||||||
|
@ -3402,15 +3402,15 @@ App::put('/v1/account/mfa/:provider')
|
||||||
default => false
|
default => false
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!$success) {
|
if (!$success) {
|
||||||
throw new Exception(Exception::USER_INVALID_TOKEN);
|
throw new Exception(Exception::USER_INVALID_TOKEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$user->getAttribute('totp')) {
|
if (!$user->getAttribute('totp')) {
|
||||||
throw new Exception(Exception::GENERAL_UNKNOWN, 'TOTP not added.');
|
throw new Exception(Exception::GENERAL_UNKNOWN, 'TOTP not added.');
|
||||||
} elseif ($user->getAttribute('totpVerification')) {
|
} elseif ($user->getAttribute('totpVerification')) {
|
||||||
throw new Exception(Exception::GENERAL_UNKNOWN, 'TOTP already verified.');
|
throw new Exception(Exception::GENERAL_UNKNOWN, 'TOTP already verified.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$user->setAttribute('totpVerification', true);
|
$user->setAttribute('totpVerification', true);
|
||||||
|
|
||||||
|
@ -3458,13 +3458,13 @@ App::delete('/v1/account/mfa/:provider')
|
||||||
default => false
|
default => false
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!$success) {
|
if (!$success) {
|
||||||
throw new Exception(Exception::USER_INVALID_TOKEN);
|
throw new Exception(Exception::USER_INVALID_TOKEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$user->getAttribute('totp')) {
|
if (!$user->getAttribute('totp')) {
|
||||||
throw new Exception(Exception::GENERAL_UNKNOWN, 'TOTP not added.');
|
throw new Exception(Exception::GENERAL_UNKNOWN, 'TOTP not added.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$user
|
$user
|
||||||
->setAttribute('totp', false)
|
->setAttribute('totp', false)
|
||||||
|
@ -3614,9 +3614,9 @@ App::put('/v1/account/mfa/challenge')
|
||||||
default => false
|
default => false
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!$success) {
|
if (!$success) {
|
||||||
throw new Exception(Exception::USER_INVALID_TOKEN);
|
throw new Exception(Exception::USER_INVALID_TOKEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
$dbForProject->deleteDocument('challenges', $challengeId);
|
$dbForProject->deleteDocument('challenges', $challengeId);
|
||||||
$dbForProject->deleteCachedDocument('users', $user->getId());
|
$dbForProject->deleteCachedDocument('users', $user->getId());
|
||||||
|
|
Loading…
Reference in a new issue