Skip to content

Commit 3619386

Browse files
Merge pull request #62968 from nextcloud/backport/61408/stable32
[stable32] fix(auth): log invalid token during password reset
2 parents e883c95 + d6a9a71 commit 3619386

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
@@ -129,6 +129,11 @@ protected function checkPasswordResetToken(string $token, string $userId): void
129129
$user = $this->userManager->get($userId);
130130
$this->verificationToken->check($token, $user, 'lostpassword', $user ? $user->getEMailAddress() : '', true);
131131
} catch (InvalidTokenException $e) {
132+
$this->logger->warning('Password reset token check failed', [
133+
'user' => $userId,
134+
'code' => $e->getCode(),
135+
'exception' => $e,
136+
]);
132137
$error = $e->getCode() === InvalidTokenException::TOKEN_EXPIRED
133138
? $this->l10n->t('Could not reset password because the token is expired')
134139
: $this->l10n->t('Could not reset password because the token is invalid');

0 commit comments

Comments
 (0)