1
0
Fork 0
mirror of synced 2024-06-28 19:20:25 +12:00

fix: totp backup code logic

This commit is contained in:
Torsten Dittmann 2024-02-29 22:55:02 +01:00
parent 8569311e73
commit 13975b8b92

View file

@ -3985,7 +3985,7 @@ App::put('/v1/account/mfa/challenge')
if (in_array($otp, $data['backups'])) {
$success = true;
$backups = array_diff($data['backups'], [$otp]);
$authenticator->setAttribute('totpBackup', $backups);
$authenticator->setAttribute('data', array_merge($data, ['backups' => $backups]));
$dbForProject->updateDocument('authenticators', $authenticator->getId(), $authenticator);
$dbForProject->purgeCachedDocument('users', $user->getId());
}