diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-04-13 12:16:38 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-13 12:16:38 -0500 |
commit | d36751ee38ee3c9994ac6f2e44313b29d893d2f7 (patch) | |
tree | 195ac1fcd6698ace48d5cfdc07e101213363afb2 /core | |
parent | ec034757fae5143621d672a02c30e62f998449f5 (diff) | |
parent | ac05d6dd6777f564ec18dbc2ca530daa4bfaa99d (diff) | |
download | nextcloud-server-d36751ee38ee3c9994ac6f2e44313b29d893d2f7.tar.gz nextcloud-server-d36751ee38ee3c9994ac6f2e44313b29d893d2f7.zip |
Merge pull request #2424 from nextcloud/fix-login-controller-test-consolidate-login
Fix login controller test and consolidate login
Diffstat (limited to 'core')
-rw-r--r-- | core/Controller/LoginController.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/core/Controller/LoginController.php b/core/Controller/LoginController.php index a61d087965f..59abf47dc80 100644 --- a/core/Controller/LoginController.php +++ b/core/Controller/LoginController.php @@ -213,6 +213,9 @@ class LoginController extends Controller { * @return RedirectResponse */ public function tryLogin($user, $password, $redirect_url, $remember_login = false, $timezone = '', $timezone_offset = '') { + if(!is_string($user)) { + throw new \InvalidArgumentException('Username must be string'); + } $currentDelay = $this->throttler->getDelay($this->request->getRemoteAddress(), 'login'); $this->throttler->sleepDelay($this->request->getRemoteAddress(), 'login'); @@ -255,7 +258,7 @@ 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->completeLogin($loginResult, ['loginName' => $user, 'password' => $password]); $this->userSession->createSessionToken($this->request, $loginResult->getUID(), $user, $password, (int)$remember_login); // User has successfully logged in, now remove the password reset link, when it is available |