Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2019-01-22 18:16:55 +0300
committerRoeland Jago Douma <roeland@famdouma.nl>2019-01-23 19:09:09 +0300
commit38f01c136163aaa095c081f166b200dd1678ff6a (patch)
tree4db68c7e28d8fd16bd1e12577d7181abff3f2e48 /tests
parente5af104517dcbc83dc64d67367fee2809647e56b (diff)
Honor remember_login_cookie_lifetime
If the remember_login_cookie_lifetime is set to 0 this means we do not want to use remember me at all. In that case we should also not creatae a remember me cookie and should create a proper temp token. Further this specifies that is not 0 the remember me time should always be larger than the session timeout. Because else the behavior is not really defined. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'tests')
-rw-r--r--tests/Core/Controller/LoginControllerTest.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/Core/Controller/LoginControllerTest.php b/tests/Core/Controller/LoginControllerTest.php
index f2e8d112b64..815a73da668 100644
--- a/tests/Core/Controller/LoginControllerTest.php
+++ b/tests/Core/Controller/LoginControllerTest.php
@@ -441,6 +441,10 @@ class LoginControllerTest extends TestCase {
$this->config->expects($this->once())
->method('setUserValue')
->with('uid', 'core', 'timezone', 'Europe/Berlin');
+ $this->config
+ ->method('getSystemValue')
+ ->with('remember_login_cookie_lifetime')
+ ->willReturn(1234);
$this->userSession->expects($this->never())
->method('createRememberMeToken');
@@ -485,6 +489,10 @@ class LoginControllerTest extends TestCase {
$this->config->expects($this->once())
->method('deleteUserValue')
->with('uid', 'core', 'lostpassword');
+ $this->config
+ ->method('getSystemValue')
+ ->with('remember_login_cookie_lifetime')
+ ->willReturn(1234);
$this->userSession->expects($this->once())
->method('createRememberMeToken')
->with($user);
@@ -545,6 +553,10 @@ class LoginControllerTest extends TestCase {
->method('deleteUserValue');
$this->userSession->expects($this->never())
->method('createRememberMeToken');
+ $this->config
+ ->method('getSystemValue')
+ ->with('remember_login_cookie_lifetime')
+ ->willReturn(1234);
$expected = new \OCP\AppFramework\Http\RedirectResponse($redirectUrl);
$this->assertEquals($expected, $this->loginController->tryLogin('Jane', $password, $originalUrl));
@@ -582,6 +594,10 @@ class LoginControllerTest extends TestCase {
$this->config->expects($this->once())
->method('deleteUserValue')
->with('jane', 'core', 'lostpassword');
+ $this->config
+ ->method('getSystemValue')
+ ->with('remember_login_cookie_lifetime')
+ ->willReturn(1234);
$expected = new \OCP\AppFramework\Http\RedirectResponse(urldecode($redirectUrl));
$this->assertEquals($expected, $this->loginController->tryLogin('Jane', $password, $originalUrl));
@@ -634,6 +650,10 @@ class LoginControllerTest extends TestCase {
$this->config->expects($this->once())
->method('deleteUserValue')
->with('john', 'core', 'lostpassword');
+ $this->config
+ ->method('getSystemValue')
+ ->with('remember_login_cookie_lifetime')
+ ->willReturn(1234);
$this->userSession->expects($this->never())
->method('createRememberMeToken');
@@ -686,6 +706,10 @@ class LoginControllerTest extends TestCase {
$this->config->expects($this->once())
->method('deleteUserValue')
->with('john', 'core', 'lostpassword');
+ $this->config
+ ->method('getSystemValue')
+ ->with('remember_login_cookie_lifetime')
+ ->willReturn(1234);
$this->userSession->expects($this->never())
->method('createRememberMeToken');