diff options
author | Christoph Wurst <christoph@owncloud.com> | 2016-04-28 11:59:26 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-05-11 13:36:46 +0200 |
commit | aa85edd2242c696954c64799e7880f7a3d39ca83 (patch) | |
tree | 06bfb0fd7b96b79da434794a033b0a900e2fd281 | |
parent | 8cc5f6036f6ff1377077da0eed1cf4350db4b7e6 (diff) | |
download | nextcloud-server-aa85edd2242c696954c64799e7880f7a3d39ca83.tar.gz nextcloud-server-aa85edd2242c696954c64799e7880f7a3d39ca83.zip |
increase token column width
add some range to time() assertions
-rw-r--r-- | build/integration/features/bootstrap/BasicStructure.php | 2 | ||||
-rw-r--r-- | core/Controller/LoginController.php | 3 | ||||
-rw-r--r-- | db_structure.xml | 2 | ||||
-rw-r--r-- | tests/core/controller/LoginControllerTest.php | 2 | ||||
-rw-r--r-- | 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 31be33165e6..60ae51dbdf0 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 63ea7babaf1..e9352b079f7 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 b78abe2974c..7b4a3b53294 100644 --- a/db_structure.xml +++ b/db_structure.xml @@ -1076,7 +1076,7 @@ <type>text</type> <default></default> <notnull>true</notnull> - <length>100</length> + <length>200</length> </field> <field> diff --git a/tests/core/controller/LoginControllerTest.php b/tests/core/controller/LoginControllerTest.php index 93e2f517179..3c94fd61c6b 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 ca03e62c3a6..ab252357d85 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') |