diff --git a/lib/private/legacy/user.php b/lib/private/legacy/user.php
index e006a59771a7b1c2d934dbd0dbba2db69b0f0127..ab87c484db4c458416dbcbbb0fd530cbd056b4f7 100644
--- a/lib/private/legacy/user.php
+++ b/lib/private/legacy/user.php
@@ -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;
 	}
diff --git a/tests/lib/NavigationManagerTest.php b/tests/lib/NavigationManagerTest.php
index 8bc1c372ac80ec6b826fa8c19683e730ca80661b..6649aba28b6c20febe52da83696e8bfcd1da8a06 100644
--- a/tests/lib/NavigationManagerTest.php
+++ b/tests/lib/NavigationManagerTest.php
@@ -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,