diff --git a/core/Controller/LostController.php b/core/Controller/LostController.php index ce98426084..d30c6ae1eb 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 61bdb21918..d372ec559d 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(