Skip to content

Commit

Permalink
Merge pull request #11857 from nextcloud/backport/10942/longer-passwo…
Browse files Browse the repository at this point in the history
…rd-reset-time

[stable13] Change password expiration time from 12h to 7d
  • Loading branch information
rullzer authored Oct 17, 2018
2 parents 329c210 + 7613801 commit e3a2b9e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/Controller/LostController.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ protected function checkPasswordResetToken($token, $userId) {
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'));
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Core/Controller/LostControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ public function testSetPasswordExpiredToken() {
->with('ValidTokenUser')
->willReturn($this->existingUser);
$this->timeFactory->method('getTime')
->willReturn(55546);
->willReturn(617146);

$this->crypto->method('decrypt')
->with(
Expand Down

0 comments on commit e3a2b9e

Please sign in to comment.