diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2017-08-10 12:46:33 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2017-08-29 20:27:36 +0200 |
commit | 84b7022118411ef1adeba710d8615cdb2720eb1a (patch) | |
tree | 0376cc0bea2d296fb790cc71413fd9603c67e970 /lib/private/Server.php | |
parent | 141bee931f0e1f51cd81772c5ac60274bc0df8d7 (diff) | |
download | nextcloud-server-84b7022118411ef1adeba710d8615cdb2720eb1a.tar.gz nextcloud-server-84b7022118411ef1adeba710d8615cdb2720eb1a.zip |
Improve 2FA
* Store the auth state in the session so we don't have to query it every
time.
* Added some tests
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/Server.php')
-rw-r--r-- | lib/private/Server.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/private/Server.php b/lib/private/Server.php index 60a5de97bbf..18f09eb30b7 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -102,6 +102,7 @@ use OC\Template\SCSSCacher; use OCA\Theming\ThemingDefaults; use OCP\App\IAppManager; +use OCP\AppFramework\Utility\ITimeFactory; use OCP\Defaults; use OCA\Theming\Util; use OCP\Federation\ICloudIdManager; @@ -379,7 +380,15 @@ 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()); + return new \OC\Authentication\TwoFactorAuth\Manager( + $c->getAppManager(), + $c->getSession(), + $c->getConfig(), + $c->getActivityManager(), + $c->getLogger(), + $c->query(\OC\Authentication\Token\IProvider::class), + $c->query(ITimeFactory::class) + ); }); $this->registerAlias(\OCP\INavigationManager::class, \OC\NavigationManager::class); |