Skip to content

Commit cf3f488

Browse files
committed
Change password expiration time from 12h to 7d
We use the same logic for creating accounts without a password and there the 12h is a bit short. Users don't expect that the signup link needs to be clicked within 12h - 7d should be a more expected behavior. Signed-off-by: Morris Jobke <hey@morrisjobke.de>
1 parent 2a22615 commit cf3f488

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

core/Controller/LostController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ protected function checkPasswordResetToken($token, $userId) {
187187
throw new \Exception($this->l10n->t('Couldn\'t reset password because the token is invalid'));
188188
}
189189

190-
if ($splittedToken[0] < ($this->timeFactory->getTime() - 60*60*12) ||
190+
if ($splittedToken[0] < ($this->timeFactory->getTime() - 60*60*24*7) ||
191191
$user->getLastLogin() > $splittedToken[0]) {
192192
throw new \Exception($this->l10n->t('Couldn\'t reset password because the token is expired'));
193193
}

tests/Core/Controller/LostControllerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ public function testSetPasswordExpiredToken() {
584584
->with('ValidTokenUser')
585585
->willReturn($this->existingUser);
586586
$this->timeFactory->method('getTime')
587-
->willReturn(55546);
587+
->willReturn(617146);
588588

589589
$this->crypto->method('decrypt')
590590
->with(

0 commit comments

Comments
 (0)