From ee0ebd192a394e4f9d4c9dd2c78b1b4d6a211c7a Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Wed, 11 May 2016 19:39:57 +0200 Subject: [PATCH] Use proper URL generation function (#24576) Fixes the redirection after login, otherwise `core/files/index` is opened which fails. --- core/Controller/LoginController.php | 2 +- tests/core/controller/LoginControllerTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/Controller/LoginController.php b/core/Controller/LoginController.php index 6985e2be87..3604473137 100644 --- a/core/Controller/LoginController.php +++ b/core/Controller/LoginController.php @@ -194,7 +194,7 @@ class LoginController extends Controller { return new RedirectResponse($location); } } - return new RedirectResponse($this->urlGenerator->linkTo('files', 'index')); + return new RedirectResponse($this->urlGenerator->linkToRoute('files.view.index')); } } diff --git a/tests/core/controller/LoginControllerTest.php b/tests/core/controller/LoginControllerTest.php index 0b5a143f4e..139d48ad7d 100644 --- a/tests/core/controller/LoginControllerTest.php +++ b/tests/core/controller/LoginControllerTest.php @@ -299,8 +299,8 @@ class LoginControllerTest extends TestCase { ->method('createSessionToken') ->with($this->request, $user->getUID(), $password); $this->urlGenerator->expects($this->once()) - ->method('linkTo') - ->with('files', 'index') + ->method('linkToRoute') + ->with('files.view.index') ->will($this->returnValue($indexPageUrl)); $expected = new \OCP\AppFramework\Http\RedirectResponse($indexPageUrl);