Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/Controller/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function __construct($appName,
* @return RedirectResponse
*/
public function logout() {
$loginToken = $this->request->getCookie('oc_token');
$loginToken = $this->request->getCookie('nc_token');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please prepare backport of this single change also to all older versions where you changed the cookie name.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okidoke 👷

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Backport in #3511

Only nc11 is affected: #1347 was not backported

if (!is_null($loginToken)) {
$this->config->deleteUserValue($this->userSession->getUser()->getUID(), 'login_token', $loginToken);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/private/AppFramework/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ public function passesCSRFCheck() {
* @return bool
*/
private function cookieCheckRequired() {
if($this->getCookie(session_name()) === null && $this->getCookie('oc_token') === null) {
if($this->getCookie(session_name()) === null && $this->getCookie('nc_token') === null) {
return false;
}

Expand Down
4 changes: 2 additions & 2 deletions tests/Core/Controller/LoginControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/AppFramework/Http/RequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1651,7 +1651,7 @@ public function testFailsStrictCookieCheckWithRememberMeCookie() {
'HTTP_REQUESTTOKEN' => 'AAAHGxsTCTc3BgMQESAcNR0OAR0=:MyTotalSecretShareds',
],
'cookies' => [
'oc_token' => 'asdf',
'nc_token' => 'asdf',
],
],
$this->secureRandom,
Expand Down