summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2018-10-17 22:14:31 +0200
committerGitHub <noreply@github.com>2018-10-17 22:14:31 +0200
commite3a2b9e3e6db6d5b5c32a5e0b345447b20fa15a1 (patch)
treef6829202400b48ce4caabeef24b4a83f19a912de
parent329c2108b50d87dca4776137ece5d8edd0050ed5 (diff)
parent7613801a58fb25135a6b925995b659b9233e149a (diff)
downloadnextcloud-server-e3a2b9e3e6db6d5b5c32a5e0b345447b20fa15a1.tar.gz
nextcloud-server-e3a2b9e3e6db6d5b5c32a5e0b345447b20fa15a1.zip
Merge pull request #11857 from nextcloud/backport/10942/longer-password-reset-time
[stable13] Change password expiration time from 12h to 7d
-rw-r--r--core/Controller/LostController.php2
-rw-r--r--tests/Core/Controller/LostControllerTest.php2
2 files changed, 2 insertions, 2 deletions
diff --git a/core/Controller/LostController.php b/core/Controller/LostController.php
index ce98426084b..d30c6ae1ebd 100644
--- a/core/Controller/LostController.php
+++ b/core/Controller/LostController.php
@@ -187,7 +187,7 @@ class LostController extends Controller {
throw new \Exception($this->l10n->t('Couldn\'t reset password because the token is invalid'));
}
- if ($splittedToken[0] < ($this->timeFactory->getTime() - 60*60*12) ||
+ if ($splittedToken[0] < ($this->timeFactory->getTime() - 60*60*24*7) ||
$user->getLastLogin() > $splittedToken[0]) {
throw new \Exception($this->l10n->t('Couldn\'t reset password because the token is expired'));
}
diff --git a/tests/Core/Controller/LostControllerTest.php b/tests/Core/Controller/LostControllerTest.php
index 61bdb219184..d372ec559d0 100644
--- a/tests/Core/Controller/LostControllerTest.php
+++ b/tests/Core/Controller/LostControllerTest.php
@@ -584,7 +584,7 @@ class LostControllerTest extends \Test\TestCase {
->with('ValidTokenUser')
->willReturn($this->existingUser);
$this->timeFactory->method('getTime')
- ->willReturn(55546);
+ ->willReturn(617146);
$this->crypto->method('decrypt')
->with(