From 13d93f5b25aa3e663146349583a0a8e01b216f7a Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Tue, 22 May 2018 08:52:16 +0200 Subject: Make 2FA providers stateful This adds persistence to the Nextcloud server 2FA logic so that the server knows which 2FA providers are enabled for a specific user at any time, even when the provider is not available. The `IStatefulProvider` interface was added as tagging interface for providers that are compatible with this new API. Signed-off-by: Christoph Wurst --- lib/private/Server.php | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'lib/private/Server.php') diff --git a/lib/private/Server.php b/lib/private/Server.php index 31f088ea718..7824638b212 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -412,18 +412,7 @@ class Server extends ServerContainer implements IServerContainer { }); $this->registerAlias('UserSession', \OCP\IUserSession::class); - $this->registerService(\OC\Authentication\TwoFactorAuth\Manager::class, function (Server $c) { - return new \OC\Authentication\TwoFactorAuth\Manager( - $c->getAppManager(), - $c->getSession(), - $c->getConfig(), - $c->getActivityManager(), - $c->getLogger(), - $c->query(IProvider::class), - $c->query(ITimeFactory::class), - $c->query(EventDispatcherInterface::class) - ); - }); + $this->registerAlias(\OCP\Authentication\TwoFactorAuth\IRegistry::class, \OC\Authentication\TwoFactorAuth\Registry::class); $this->registerAlias(\OCP\INavigationManager::class, \OC\NavigationManager::class); $this->registerAlias('NavigationManager', \OCP\INavigationManager::class); -- cgit v1.2.3