summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2016-11-02 18:32:38 +0100
committerGitHub <noreply@github.com>2016-11-02 18:32:38 +0100
commite6b52ef4cd1a92004895320d52f08b44a8b422d3 (patch)
treef83153d562040f0a2c4f4b34abb42acbd1edc0a8 /core
parente81d04cd8d2ac0de3d06d4586550469384c5d91a (diff)
parent4da6b20e768574e2ec6a7da590273e18b64ddda5 (diff)
downloadnextcloud-server-e6b52ef4cd1a92004895320d52f08b44a8b422d3.tar.gz
nextcloud-server-e6b52ef4cd1a92004895320d52f08b44a8b422d3.zip
Merge pull request #1347 from nextcloud/bring-back-remember-me
fix remember me login
Diffstat (limited to 'core')
-rw-r--r--core/Controller/LoginController.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/core/Controller/LoginController.php b/core/Controller/LoginController.php
index 884eea8869e..71478470ffe 100644
--- a/core/Controller/LoginController.php
+++ b/core/Controller/LoginController.php
@@ -196,9 +196,10 @@ class LoginController extends Controller {
* @param string $user
* @param string $password
* @param string $redirect_url
+ * @param boolean $remember_login
* @return RedirectResponse
*/
- public function tryLogin($user, $password, $redirect_url) {
+ public function tryLogin($user, $password, $redirect_url, $remember_login = false) {
$currentDelay = $this->throttler->getDelay($this->request->getRemoteAddress());
$this->throttler->sleepDelay($this->request->getRemoteAddress());
@@ -236,13 +237,13 @@ class LoginController extends Controller {
// 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(), $user, $password);
+ $this->userSession->createSessionToken($this->request, $loginResult->getUID(), $user, $password, $remember_login);
// User has successfully logged in, now remove the password reset link, when it is available
$this->config->deleteUserValue($loginResult->getUID(), 'core', 'lostpassword');
if ($this->twoFactorManager->isTwoFactorAuthenticated($loginResult)) {
- $this->twoFactorManager->prepareTwoFactorLogin($loginResult);
+ $this->twoFactorManager->prepareTwoFactorLogin($loginResult, $remember_login);
$providers = $this->twoFactorManager->getProviders($loginResult);
if (count($providers) === 1) {
@@ -265,6 +266,10 @@ class LoginController extends Controller {
return new RedirectResponse($this->urlGenerator->linkToRoute($url, $urlParams));
}
+ if ($remember_login) {
+ $this->userSession->createRememberMeToken($loginResult);
+ }
+
return $this->generateRedirect($redirect_url);
}