Skip to content

Commit

Permalink
Delay login of admin user after setup so that firstLogin event can pr…
Browse files Browse the repository at this point in the history
…operly be processed for the admin
  • Loading branch information
DeepDiver1975 committed Sep 29, 2016
1 parent 1a43cf2 commit 202e102
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/private/Setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,15 +366,6 @@ public function install($options) {
$group =\OC::$server->getGroupManager()->createGroup('admin');
$group->addUser($user);

// Create a session token for the newly created user
// The token provider requires a working db, so it's not injected on setup
/* @var $userSession User\Session */
$userSession = \OC::$server->getUserSession();
$defaultTokenProvider = \OC::$server->query('OC\Authentication\Token\DefaultTokenProvider');
$userSession->setTokenProvider($defaultTokenProvider);
$userSession->login($username, $password);
$userSession->createSessionToken($request, $userSession->getUser()->getUID(), $username, $password);

//guess what this does
Installer::installShippedApps();

Expand All @@ -395,6 +386,15 @@ public function install($options) {

//and we are done
$config->setSystemValue('installed', true);

// Create a session token for the newly created user
// The token provider requires a working db, so it's not injected on setup
/* @var $userSession User\Session */
$userSession = \OC::$server->getUserSession();
$defaultTokenProvider = \OC::$server->query('OC\Authentication\Token\DefaultTokenProvider');
$userSession->setTokenProvider($defaultTokenProvider);
$userSession->login($username, $password);
$userSession->createSessionToken($request, $userSession->getUser()->getUID(), $username, $password);
}

return $error;
Expand Down

0 comments on commit 202e102

Please sign in to comment.