From 194c61a47f69e7f32724dfcb2df704d3e4fd6e94 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Sun, 25 Feb 2024 11:47:22 +0100 Subject: [PATCH] fix: mfa backup codes --- app/controllers/api/account.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index eec259f321..dbe5cc7983 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -3918,11 +3918,11 @@ App::put('/v1/account/mfa/challenge') }; if (!$success && $provider === 'totp') { - $backups = $user->getAttribute('mfaBackups', []); + $backups = $user->getAttribute('totpBackup', []); if (in_array($otp, $backups)) { $success = true; $backups = array_diff($backups, [$otp]); - $user->setAttribute('mfaBackups', $backups); + $user->setAttribute('totpBackup', $backups); $dbForProject->updateDocument('users', $user->getId(), $user); } }