diff options
author | Christoph Wurst <christoph@owncloud.com> | 2016-05-24 09:49:40 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@owncloud.com> | 2016-05-24 09:49:40 +0200 |
commit | a0ccebfdcb2bf957086418e29981fef57e2e09bf (patch) | |
tree | aa11395c28e89969c9851174fac721da5b015d27 | |
parent | 4128b853e559935794e181439faa01dd5f884e36 (diff) | |
download | nextcloud-server-a0ccebfdcb2bf957086418e29981fef57e2e09bf.tar.gz nextcloud-server-a0ccebfdcb2bf957086418e29981fef57e2e09bf.zip |
generate device token for UID, not login name
fixes #24785
-rw-r--r-- | core/Controller/TokenController.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/Controller/TokenController.php b/core/Controller/TokenController.php index 6606a3c8345..08ad61ebaf0 100644 --- a/core/Controller/TokenController.php +++ b/core/Controller/TokenController.php @@ -75,13 +75,14 @@ class TokenController extends Controller { $response->setStatus(Http::STATUS_UNPROCESSABLE_ENTITY); return $response; } - if ($this->userManager->checkPassword($user, $password) === false) { + $loginResult = $this->userManager->checkPassword($user, $password); + if ($loginResult === false) { $response = new Response(); $response->setStatus(Http::STATUS_UNAUTHORIZED); return $response; } $token = $this->secureRandom->generate(128); - $this->tokenProvider->generateToken($token, $user, $password, $name, IToken::PERMANENT_TOKEN); + $this->tokenProvider->generateToken($token, $loginResult->getUID(), $password, $name, IToken::PERMANENT_TOKEN); return [ 'token' => $token, ]; |