Skip to content

Commit

Permalink
Fix setting up 2FA providers when 2FA is enforced and bc are generated
Browse files Browse the repository at this point in the history
When a user has backup codes generated and got their 2FA enforced then
they should be able to set up TOTP and similar providers during the
login.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
  • Loading branch information
ChristophWurst authored and backportbot[bot] committed Aug 25, 2021
1 parent 34b5d97 commit 0629b58
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/Middleware/TwoFactorMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function beforeController($controller, $methodName) {
&& !$this->reflector->hasAnnotation('TwoFactorSetUpDoneRequired')) {
$providers = $this->twoFactorManager->getProviderSet($this->userSession->getUser());

if (!($providers->getProviders() === [] && !$providers->isProviderMissing())) {
if (!($providers->getPrimaryProviders() === [] && !$providers->isProviderMissing())) {
throw new TwoFactorAuthRequiredException();
}
}
Expand Down

0 comments on commit 0629b58

Please sign in to comment.