diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-05-24 17:51:49 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2016-05-24 17:51:49 +0200 |
commit | d3fb5d618ea5902c989c39d72fd6ac2e5bcb65ed (patch) | |
tree | 815818e3077c629a5b5fe8a63213e4867546d5b6 /apps | |
parent | e8c37943081975b01f5dedc2284892a5335322f8 (diff) | |
parent | ad10485cec4377119aa14749e8e4aeda6e707f8e (diff) | |
download | nextcloud-server-d3fb5d618ea5902c989c39d72fd6ac2e5bcb65ed.tar.gz nextcloud-server-d3fb5d618ea5902c989c39d72fd6ac2e5bcb65ed.zip |
Merge pull request #24748 from owncloud/login-explicitly
Log in explicitly, save login name when generating browser/device tokens
Diffstat (limited to 'apps')
-rw-r--r-- | apps/dav/lib/Connector/Sabre/Auth.php | 2 | ||||
-rw-r--r-- | apps/dav/tests/unit/connector/sabre/auth.php | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/apps/dav/lib/Connector/Sabre/Auth.php b/apps/dav/lib/Connector/Sabre/Auth.php index 69301096b49..88898f272c5 100644 --- a/apps/dav/lib/Connector/Sabre/Auth.php +++ b/apps/dav/lib/Connector/Sabre/Auth.php @@ -105,7 +105,7 @@ class Auth extends AbstractBasic { \OC_Util::setUpFS(); //login hooks may need early access to the filesystem // TODO: do not allow basic auth if the user is 2FA enforced if($this->userSession->login($username, $password)) { - $this->userSession->createSessionToken($this->request, $username, $password); + $this->userSession->createSessionToken($this->request, $this->userSession->getUser()->getUID(), $username, $password); \OC_Util::setUpFS($this->userSession->getUser()->getUID()); $this->session->set(self::DAV_AUTHENTICATED, $this->userSession->getUser()->getUID()); $this->session->close(); diff --git a/apps/dav/tests/unit/connector/sabre/auth.php b/apps/dav/tests/unit/connector/sabre/auth.php index a0168e435e2..42be21d90fe 100644 --- a/apps/dav/tests/unit/connector/sabre/auth.php +++ b/apps/dav/tests/unit/connector/sabre/auth.php @@ -149,7 +149,7 @@ class Auth extends TestCase { $user = $this->getMockBuilder('\OCP\IUser') ->disableOriginalConstructor() ->getMock(); - $user->expects($this->exactly(3)) + $user->expects($this->exactly(4)) ->method('getUID') ->will($this->returnValue('MyTestUser')); $this->userSession @@ -157,7 +157,7 @@ class Auth extends TestCase { ->method('isLoggedIn') ->will($this->returnValue(true)); $this->userSession - ->expects($this->exactly(3)) + ->expects($this->exactly(4)) ->method('getUser') ->will($this->returnValue($user)); $this->session @@ -173,7 +173,7 @@ class Auth extends TestCase { $this->userSession ->expects($this->once()) ->method('createSessionToken') - ->with($this->request, 'MyTestUser', 'MyTestPassword'); + ->with($this->request, 'MyTestUser', 'MyTestUser', 'MyTestPassword'); $this->session ->expects($this->once()) ->method('set') @@ -569,11 +569,11 @@ class Auth extends TestCase { $user = $this->getMockBuilder('\OCP\IUser') ->disableOriginalConstructor() ->getMock(); - $user->expects($this->exactly(3)) + $user->expects($this->exactly(4)) ->method('getUID') ->will($this->returnValue('MyTestUser')); $this->userSession - ->expects($this->exactly(3)) + ->expects($this->exactly(4)) ->method('getUser') ->will($this->returnValue($user)); $response = $this->auth->check($server->httpRequest, $server->httpResponse); |