Merge pull request #30193 from nextcloud/fix/set-up-2fa-no-providers-but-backup-codes

Fix setting up 2FA when no providers are set up but backup codes
This commit is contained in:
Christoph Wurst 2021-12-13 16:05:35 +01:00 committed by GitHub
commit f287be5424
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -109,7 +109,7 @@ class TwoFactorMiddleware extends Middleware {
&& $this->twoFactorManager->needsSecondFactor($this->userSession->getUser())) {
$providers = $this->twoFactorManager->getProviderSet($this->userSession->getUser());
if ($providers->getProviders() === [] && !$providers->isProviderMissing()) {
if ($providers->getPrimaryProviders() === [] && !$providers->isProviderMissing()) {
return;
}
}