From c6071e027cb54ed9c8dcc374ef87cb6ff5e1a7ba Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Thu, 16 Feb 2017 16:27:20 +0100 Subject: [PATCH 1/2] Fix cookie name (nc_token instead of oc_token) Signed-off-by: Christoph Wurst --- core/Controller/LoginController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/Controller/LoginController.php b/core/Controller/LoginController.php index 3c81ed5242ab6..8f10f1631abc3 100644 --- a/core/Controller/LoginController.php +++ b/core/Controller/LoginController.php @@ -98,7 +98,7 @@ function __construct($appName, * @return RedirectResponse */ public function logout() { - $loginToken = $this->request->getCookie('oc_token'); + $loginToken = $this->request->getCookie('nc_token'); if (!is_null($loginToken)) { $this->config->deleteUserValue($this->userSession->getUser()->getUID(), 'login_token', $loginToken); } From 48554db156ffa451b9d4463fdbcdbee84697f5af Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Thu, 16 Feb 2017 10:29:45 -0600 Subject: [PATCH 2/2] fix unit tests Signed-off-by: Morris Jobke --- tests/Core/Controller/LoginControllerTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Core/Controller/LoginControllerTest.php b/tests/Core/Controller/LoginControllerTest.php index 600179a1dc5f3..8132f2eec0b96 100644 --- a/tests/Core/Controller/LoginControllerTest.php +++ b/tests/Core/Controller/LoginControllerTest.php @@ -89,7 +89,7 @@ public function testLogoutWithoutToken() { $this->request ->expects($this->once()) ->method('getCookie') - ->with('oc_token') + ->with('nc_token') ->willReturn(null); $this->config ->expects($this->never()) @@ -108,7 +108,7 @@ public function testLogoutWithToken() { $this->request ->expects($this->once()) ->method('getCookie') - ->with('oc_token') + ->with('nc_token') ->willReturn('MyLoginToken'); $user = $this->getMockBuilder('\\OCP\\IUser')->getMock(); $user