Merge pull request #13757 from nextcloud/enh/also_cache_logout_route

Allow caching of the logout route
This commit is contained in:
Roeland Jago Douma 2019-01-23 15:32:36 +01:00 committed by GitHub
commit 68c0fd3863
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 16 deletions

View File

@ -269,12 +269,8 @@ class OC_User {
return $backend->getLogoutUrl();
}
$logoutUrl = $urlGenerator->linkToRouteAbsolute(
'core.login.logout',
[
'requesttoken' => \OCP\Util::callRegister(),
]
);
$logoutUrl = $urlGenerator->linkToRouteAbsolute('core.login.logout');
$logoutUrl .= '?requesttoken=' . \OCP\Util::callRegister();
return $logoutUrl;
}

View File

@ -221,15 +221,10 @@ class NavigationManagerTest extends TestCase {
return '/apps/test/';
});
$this->urlGenerator
->expects($this->once())
->method('linkToRouteAbsolute')
->with(
'core.login.logout',
[
'requesttoken' => \OCP\Util::callRegister()
]
)
->willReturn('https://example.com/logout');
->expects($this->once())
->method('linkToRouteAbsolute')
->with('core.login.logout')
->willReturn('https://example.com/logout');
$user = $this->createMock(IUser::class);
$user->expects($this->any())->method('getUID')->willReturn('user001');
$this->userSession->expects($this->any())->method('getUser')->willReturn($user);
@ -275,7 +270,7 @@ class NavigationManagerTest extends TestCase {
'logout' => [
'id' => 'logout',
'order' => 99999,
'href' => 'https://example.com/logout',
'href' => 'https://example.com/logout?requesttoken='. \OCP\Util::callRegister(),
'icon' => '/apps/core/img/actions/logout.svg',
'name' => 'Log out',
'active' => false,