Skip to content

Commit f1266e6

Browse files
Merge pull request #62970 from nextcloud/backport/61408/stable34
[stable34] fix(auth): log invalid token during password reset
2 parents 8a0eaca + 80b3038 commit f1266e6

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎core/Controller/LostController.php‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ protected function checkPasswordResetToken(string $token, string $userId): void
124124
$user = $this->userManager->get($userId);
125125
$this->verificationToken->check($token, $user, 'lostpassword', $user ? $user->getEMailAddress() : '', true);
126126
} catch (InvalidTokenException $e) {
127+
$this->logger->warning('Password reset token check failed', [
128+
'user' => $userId,
129+
'code' => $e->getCode(),
130+
'exception' => $e,
131+
]);
127132
$error = $e->getCode() === InvalidTokenException::TOKEN_EXPIRED
128133
? $this->l10n->t('Could not reset password because the token is expired')
129134
: $this->l10n->t('Could not reset password because the token is invalid');

0 commit comments

Comments
 (0)