From 8f5375d91a8985f3eeefbdf905b86a1d4f5af780 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 17 Nov 2020 14:42:10 +0100 Subject: [PATCH] Fix TOTP flood control --- .../system/user/multifactor/TotpMultifactorMethod.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/system/user/multifactor/TotpMultifactorMethod.class.php b/wcfsetup/install/files/lib/system/user/multifactor/TotpMultifactorMethod.class.php index abf110540f..e323661e90 100644 --- a/wcfsetup/install/files/lib/system/user/multifactor/TotpMultifactorMethod.class.php +++ b/wcfsetup/install/files/lib/system/user/multifactor/TotpMultifactorMethod.class.php @@ -284,8 +284,8 @@ class TotpMultifactorMethod implements IMultifactorMethod { ->autoFocus() ->required() ->addValidator(new FormFieldValidator('code', function (CodeFormField $field) use ($devices, $setup) { - FloodControl::getInstance()->registerUserContent('com.woltlab.wcf.multifactor.backup', $setup->getId()); - $attempts = FloodControl::getInstance()->countUserContent('com.woltlab.wcf.multifactor.backup', $setup->getId(), new \DateInterval('PT10M')); + FloodControl::getInstance()->registerUserContent('com.woltlab.wcf.multifactor.totp', $setup->getId()); + $attempts = FloodControl::getInstance()->countUserContent('com.woltlab.wcf.multifactor.totp', $setup->getId(), new \DateInterval('PT10M')); if ($attempts['count'] > self::USER_ATTEMPTS_PER_TEN_MINUTES) { $field->value(''); $field->addValidationError(new FormFieldValidationError( -- 2.20.1