From 21d3fe588396ebb3535a947ee4afd514aa24bd78 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Mon, 2 Jan 2017 11:57:05 +0100 Subject: do not hard-require the token provider The provider might need DB access and therefore depenedency resolution fails on the setup page where we cannot inject the db implementation. Signed-off-by: Christoph Wurst --- lib/private/Server.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/private/Server.php') diff --git a/lib/private/Server.php b/lib/private/Server.php index 45ed9d5e3bc..903e05925ee 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -250,9 +250,13 @@ class Server extends ServerContainer implements IServerContainer { }); $this->registerService(Store::class, function(Server $c) { $session = $c->getSession(); - $tokenProvider = $c->query('OC\Authentication\Token\DefaultTokenProvider'); + if (\OC::$server->getSystemConfig()->getValue('installed', false)) { + $tokenProvider = $c->query('OC\Authentication\Token\IProvider'); + } else { + $tokenProvider = null; + } $logger = $c->getLogger(); - return new Store($session, $tokenProvider, $logger); + return new Store($session, $logger, $tokenProvider); }); $this->registerAlias(IStore::class, Store::class); $this->registerService('OC\Authentication\Token\DefaultTokenMapper', function (Server $c) { -- cgit v1.2.3