From aa85edd2242c696954c64799e7880f7a3d39ca83 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Thu, 28 Apr 2016 11:59:26 +0200 Subject: [PATCH] increase token column width add some range to time() assertions --- build/integration/features/bootstrap/BasicStructure.php | 2 +- core/Controller/LoginController.php | 3 +-- db_structure.xml | 2 +- tests/core/controller/LoginControllerTest.php | 2 +- tests/lib/user/session.php | 4 ++-- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/build/integration/features/bootstrap/BasicStructure.php b/build/integration/features/bootstrap/BasicStructure.php index 31be33165e..60ae51dbdf 100644 --- a/build/integration/features/bootstrap/BasicStructure.php +++ b/build/integration/features/bootstrap/BasicStructure.php @@ -176,7 +176,7 @@ trait BasicStructure { * @param string $user */ public function loggingInUsingWebAs($user) { - $loginUrl = substr($this->baseUrl, 0, -5); + $loginUrl = substr($this->baseUrl, 0, -5) . '/login'; // Request a new session and extract CSRF token $client = new Client(); $response = $client->get( diff --git a/core/Controller/LoginController.php b/core/Controller/LoginController.php index 63ea7babaf..e9352b079f 100644 --- a/core/Controller/LoginController.php +++ b/core/Controller/LoginController.php @@ -157,7 +157,6 @@ class LoginController extends Controller { } /** - * @NoCSRFRequired * @PublicPage * @UseSession * @@ -177,7 +176,7 @@ class LoginController extends Controller { } } if ($loginResult) { - return new RedirectResponse($this->urlGenerator->linkToRoute('login#showLoginForm')); + return new RedirectResponse($this->urlGenerator->linkToRoute('core.login.showLoginForm')); } $this->userSession->createSessionToken($this->request, $user, $password); if (!is_null($redirect_url) && $this->userSession->isLoggedIn()) { diff --git a/db_structure.xml b/db_structure.xml index b78abe2974..7b4a3b5329 100644 --- a/db_structure.xml +++ b/db_structure.xml @@ -1076,7 +1076,7 @@ text true - 100 + 200 diff --git a/tests/core/controller/LoginControllerTest.php b/tests/core/controller/LoginControllerTest.php index 93e2f51717..3c94fd61c6 100644 --- a/tests/core/controller/LoginControllerTest.php +++ b/tests/core/controller/LoginControllerTest.php @@ -277,7 +277,7 @@ class LoginControllerTest extends TestCase { ->will($this->returnValue(false)); $this->urlGenerator->expects($this->once()) ->method('linkToRoute') - ->with('login#showLoginForm') + ->with('core.login.showLoginForm') ->will($this->returnValue($loginPageUrl)); $this->userSession->expects($this->never()) diff --git a/tests/lib/user/session.php b/tests/lib/user/session.php index ca03e62c3a..ab252357d8 100644 --- a/tests/lib/user/session.php +++ b/tests/lib/user/session.php @@ -59,7 +59,7 @@ class Session extends \Test\TestCase { ->will($this->returnValue(true)); $session->expects($this->at(2)) ->method('set') - ->with('last_login_check', time()); + ->with('last_login_check', $this->equalTo(time(), 10)); $session->expects($this->at(3)) ->method('get') @@ -70,7 +70,7 @@ class Session extends \Test\TestCase { ->with($token); $session->expects($this->at(4)) ->method('set') - ->with('last_token_update', time()); + ->with('last_token_update', $this->equalTo(time(), 10)); $manager->expects($this->any()) ->method('get')