Merge pull request from ArthurHoaro/feature/session-protection-stay-login

Do not check the IP address with session protection disabled
This commit is contained in:
ArthurHoaro 2019-02-09 12:36:31 +01:00 committed by GitHub
commit 905f8675a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions
tests/security

View file

@ -260,6 +260,20 @@ class LoginManagerTest extends TestCase
);
}
/**
* Generate a token depending on the user credentials with session protected disabled
*/
public function testGenerateStaySignedInTokenSessionProtectionDisabled()
{
$this->configManager->set('security.session_protection_disabled', true);
$this->loginManager->generateStaySignedInToken($this->clientIpAddress);
$this->assertEquals(
sha1($this->passwordHash . $this->salt),
$this->loginManager->getStaySignedInToken()
);
}
/**
* Check user login - Shaarli has not yet been configured
*/