mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
fix: merge conflicts
This commit is contained in:
@@ -1205,6 +1205,7 @@ $collections = [
|
||||
]
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
$commonCollections = [
|
||||
'users' => [
|
||||
|
||||
@@ -3292,18 +3292,18 @@ App::post('/v1/account/mfa/:provider')
|
||||
|
||||
$backups = Provider::generateBackupCodes();
|
||||
|
||||
switch ($provider) {
|
||||
case 'totp':
|
||||
if ($user->getAttribute('totp') && $user->getAttribute('totpVerification')) {
|
||||
throw new Exception(Exception::GENERAL_UNKNOWN, 'TOTP already exists.');
|
||||
}
|
||||
$user
|
||||
->setAttribute('totp', true)
|
||||
->setAttribute('totpVerification', false)
|
||||
->setAttribute('totpBackup', $backups)
|
||||
->setAttribute('totpSecret', $otp->getSecret());
|
||||
break;
|
||||
}
|
||||
switch ($provider) {
|
||||
case 'totp':
|
||||
if ($user->getAttribute('totp') && $user->getAttribute('totpVerification')) {
|
||||
throw new Exception(Exception::GENERAL_UNKNOWN, 'TOTP already exists.');
|
||||
}
|
||||
$user
|
||||
->setAttribute('totp', true)
|
||||
->setAttribute('totpVerification', false)
|
||||
->setAttribute('totpBackup', $backups)
|
||||
->setAttribute('totpSecret', $otp->getSecret());
|
||||
break;
|
||||
}
|
||||
|
||||
$model = new Document();
|
||||
$model
|
||||
@@ -3351,20 +3351,20 @@ App::put('/v1/account/mfa/:provider')
|
||||
default => false
|
||||
};
|
||||
|
||||
if (!$success) {
|
||||
throw new Exception(Exception::USER_INVALID_TOKEN);
|
||||
}
|
||||
if (!$success) {
|
||||
throw new Exception(Exception::USER_INVALID_TOKEN);
|
||||
}
|
||||
|
||||
switch ($provider) {
|
||||
case 'totp':
|
||||
if (!$user->getAttribute('totp')) {
|
||||
throw new Exception(Exception::GENERAL_UNKNOWN, 'TOTP not added.');
|
||||
} elseif ($user->getAttribute('totpVerification')) {
|
||||
throw new Exception(Exception::GENERAL_UNKNOWN, 'TOTP already verified.');
|
||||
}
|
||||
$user->setAttribute('totpVerification', true);
|
||||
break;
|
||||
}
|
||||
switch ($provider) {
|
||||
case 'totp':
|
||||
if (!$user->getAttribute('totp')) {
|
||||
throw new Exception(Exception::GENERAL_UNKNOWN, 'TOTP not added.');
|
||||
} elseif ($user->getAttribute('totpVerification')) {
|
||||
throw new Exception(Exception::GENERAL_UNKNOWN, 'TOTP already verified.');
|
||||
}
|
||||
$user->setAttribute('totpVerification', true);
|
||||
break;
|
||||
}
|
||||
|
||||
$user = $dbForProject->withRequestTimestamp($requestTimestamp, fn () => $dbForProject->updateDocument('users', $user->getId(), $user));
|
||||
|
||||
@@ -3508,9 +3508,9 @@ App::put('/v1/account/mfa/challenge')
|
||||
default => false
|
||||
};
|
||||
|
||||
if (!$success) {
|
||||
throw new Exception(Exception::USER_INVALID_TOKEN);
|
||||
}
|
||||
if (!$success) {
|
||||
throw new Exception(Exception::USER_INVALID_TOKEN);
|
||||
}
|
||||
|
||||
$dbForProject->deleteDocument('challenges', $challengeId);
|
||||
$dbForProject->deleteCachedDocument('users', $user->getId());
|
||||
|
||||
Reference in New Issue
Block a user