login explicitly
This commit is contained in:
parent
adcf942901
commit
4128b853e5
3 changed files with 10 additions and 9 deletions
|
@ -190,6 +190,9 @@ class LoginController extends Controller {
|
||||||
$args = !is_null($user) ? ['user' => $user] : [];
|
$args = !is_null($user) ? ['user' => $user] : [];
|
||||||
return new RedirectResponse($this->urlGenerator->linkToRoute('core.login.showLoginForm', $args));
|
return new RedirectResponse($this->urlGenerator->linkToRoute('core.login.showLoginForm', $args));
|
||||||
}
|
}
|
||||||
|
// TODO: remove password checks from above and let the user session handle failures
|
||||||
|
// requires https://github.com/owncloud/core/pull/24616
|
||||||
|
$this->userSession->login($user, $password);
|
||||||
$this->userSession->createSessionToken($this->request, $loginResult->getUID(), $password);
|
$this->userSession->createSessionToken($this->request, $loginResult->getUID(), $password);
|
||||||
|
|
||||||
if ($this->twoFactorManager->isTwoFactorAuthenticated($loginResult)) {
|
if ($this->twoFactorManager->isTwoFactorAuthenticated($loginResult)) {
|
||||||
|
|
|
@ -371,6 +371,7 @@ class Setup {
|
||||||
$userSession = \OC::$server->getUserSession();
|
$userSession = \OC::$server->getUserSession();
|
||||||
$defaultTokenProvider = \OC::$server->query('OC\Authentication\Token\DefaultTokenProvider');
|
$defaultTokenProvider = \OC::$server->query('OC\Authentication\Token\DefaultTokenProvider');
|
||||||
$userSession->setTokenProvider($defaultTokenProvider);
|
$userSession->setTokenProvider($defaultTokenProvider);
|
||||||
|
$userSession->login($username, $password);
|
||||||
$userSession->createSessionToken($request, $username, $password);
|
$userSession->createSessionToken($request, $username, $password);
|
||||||
|
|
||||||
//guess what this does
|
//guess what this does
|
||||||
|
|
|
@ -397,16 +397,13 @@ class Session implements IUserSession, Emitter {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$name = isset($request->server['HTTP_USER_AGENT']) ? $request->server['HTTP_USER_AGENT'] : 'unknown browser';
|
$name = isset($request->server['HTTP_USER_AGENT']) ? $request->server['HTTP_USER_AGENT'] : 'unknown browser';
|
||||||
$loggedIn = $this->login($uid, $password);
|
try {
|
||||||
if ($loggedIn) {
|
$sessionId = $this->session->getId();
|
||||||
try {
|
$this->tokenProvider->generateToken($sessionId, $uid, $password, $name);
|
||||||
$sessionId = $this->session->getId();
|
} catch (SessionNotAvailableException $ex) {
|
||||||
$this->tokenProvider->generateToken($sessionId, $uid, $password, $name);
|
|
||||||
} catch (SessionNotAvailableException $ex) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return $loggedIn;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue