1
0
Fork 0
mirror of synced 2024-10-01 17:58:02 +13:00

chore: run linter

This commit is contained in:
Torsten Dittmann 2024-01-12 14:06:52 +01:00
parent e2a0c2d825
commit 0a4c62085c

View file

@ -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());