From a34085e1a2b31c28157b1799e0bd4dfcbf9ab638 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Fri, 16 Apr 2021 14:54:14 +0200 Subject: [PATCH] Move 2fa backupscode to new registration Signed-off-by: Roeland Jago Douma --- apps/twofactor_backupcodes/appinfo/info.xml | 6 +----- apps/twofactor_backupcodes/lib/AppInfo/Application.php | 4 ++++ lib/private/Authentication/TwoFactorAuth/ProviderLoader.php | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/twofactor_backupcodes/appinfo/info.xml b/apps/twofactor_backupcodes/appinfo/info.xml index 0d50a66ea6..513f7d0821 100644 --- a/apps/twofactor_backupcodes/appinfo/info.xml +++ b/apps/twofactor_backupcodes/appinfo/info.xml @@ -5,7 +5,7 @@ Two factor backup codes A two-factor auth backup codes provider A two-factor auth backup codes provider - 1.10.0 + 1.10.1 agpl Christoph Wurst TwoFactorBackupCodes @@ -22,10 +22,6 @@ - - OCA\TwoFactorBackupCodes\Provider\BackupCodesProvider - - OCA\TwoFactorBackupCodes\Activity\Provider diff --git a/apps/twofactor_backupcodes/lib/AppInfo/Application.php b/apps/twofactor_backupcodes/lib/AppInfo/Application.php index 8751ccb8f6..5dce6d3a8e 100644 --- a/apps/twofactor_backupcodes/lib/AppInfo/Application.php +++ b/apps/twofactor_backupcodes/lib/AppInfo/Application.php @@ -36,6 +36,7 @@ use OCA\TwoFactorBackupCodes\Listener\ProviderEnabled; use OCA\TwoFactorBackupCodes\Listener\RegistryUpdater; use OCA\TwoFactorBackupCodes\Listener\UserDeleted; use OCA\TwoFactorBackupCodes\Notifications\Notifier; +use OCA\TwoFactorBackupCodes\Provider\BackupCodesProvider; use OCP\AppFramework\App; use OCP\AppFramework\Bootstrap\IBootContext; use OCP\AppFramework\Bootstrap\IBootstrap; @@ -59,6 +60,9 @@ class Application extends App implements IBootstrap { $context->registerEventListener(IRegistry::EVENT_PROVIDER_ENABLED, ProviderEnabled::class); $context->registerEventListener(IRegistry::EVENT_PROVIDER_DISABLED, ProviderDisabled::class); $context->registerEventListener(UserDeletedEvent::class, UserDeleted::class); + + + $context->registerTwoFactorProvider(BackupCodesProvider::class); } public function boot(IBootContext $context): void { diff --git a/lib/private/Authentication/TwoFactorAuth/ProviderLoader.php b/lib/private/Authentication/TwoFactorAuth/ProviderLoader.php index 57b9413feb..8dd1969024 100644 --- a/lib/private/Authentication/TwoFactorAuth/ProviderLoader.php +++ b/lib/private/Authentication/TwoFactorAuth/ProviderLoader.php @@ -76,7 +76,7 @@ class ProviderLoader { } } - $registeredProviders = $this->coordinator->getRegistrationContext()->getTwoFactorProvider(); + $registeredProviders = $this->coordinator->getRegistrationContext()->getTwoFactorProviders(); foreach ($registeredProviders as $provider) { try { $this->loadTwoFactorApp($provider->getAppId());