summaryrefslogtreecommitdiffstats
path: root/lib/private/Authentication/TwoFactorAuth/ProviderSet.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Authentication/TwoFactorAuth/ProviderSet.php')
-rw-r--r--lib/private/Authentication/TwoFactorAuth/ProviderSet.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/private/Authentication/TwoFactorAuth/ProviderSet.php b/lib/private/Authentication/TwoFactorAuth/ProviderSet.php
index bbb9467798b..63012d9ab55 100644
--- a/lib/private/Authentication/TwoFactorAuth/ProviderSet.php
+++ b/lib/private/Authentication/TwoFactorAuth/ProviderSet.php
@@ -25,6 +25,8 @@ declare(strict_types=1);
namespace OC\Authentication\TwoFactorAuth;
+use function array_filter;
+use OCA\TwoFactorBackupCodes\Provider\BackupCodesProvider;
use OCP\Authentication\TwoFactorAuth\IProvider;
/**
@@ -65,6 +67,15 @@ class ProviderSet {
return $this->providers;
}
+ /**
+ * @return IProvider[]
+ */
+ public function get3rdPartyProviders(): array {
+ return array_filter($this->providers, function(IProvider $provider) {
+ return !($provider instanceof BackupCodesProvider);
+ });
+ }
+
public function isProviderMissing(): bool {
return $this->providerMissing;
}