Fix setting up 2FA providers when 2FA is enforced and bc are generated

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>
This commit is contained in:
Christoph Wurst 2021-07-30 18:29:23 +02:00
parent 904a762de7
commit 2fca843cc0
No known key found for this signature in database
GPG key ID: CC42AC2A7F0E56D8

View file

@ -92,7 +92,7 @@ class TwoFactorMiddleware extends Middleware {
&& !$this->reflector->hasAnnotation('TwoFactorSetUpDoneRequired')) {
$providers = $this->twoFactorManager->getProviderSet($this->userSession->getUser());
if (!($providers->getProviders() === [] && !$providers->isProviderMissing())) {
if (!($providers->getPrimaryProviders() === [] && !$providers->isProviderMissing())) {
throw new TwoFactorAuthRequiredException();
}
}