From 6d6eff178d4a6193ee50224db070c0d160d5b37e Mon Sep 17 00:00:00 2001
From: Torben Hansen <derhansen@gmail.com>
Date: Wed, 5 Jul 2023 22:27:43 +0200
Subject: [PATCH] [TASK] Streamline backend password reset log message

The current backend password reset log message misses a `}` and logs
the `user_id` if a password has been reset successfully. Logging the
`user_id` is however not inline with other user related log messages,
where always the `username` is logged.

This patch streamlines the log message with other user related log
messages by including the `username` instead of the `user_id`.

Resolves: #99354
Releases: main, 12.4
Signed-off-by: Torben Hansen <derhansen@gmail.com>
Change-Id: If18d3b4cd1a76008f56f5433e8ff5d591898d2ad
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/79824
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Tested-by: core-ci <typo3@b13.com>
---
 typo3/sysext/backend/Classes/Authentication/PasswordReset.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/typo3/sysext/backend/Classes/Authentication/PasswordReset.php b/typo3/sysext/backend/Classes/Authentication/PasswordReset.php
index 599ed79cdfba..dff67b08925e 100644
--- a/typo3/sysext/backend/Classes/Authentication/PasswordReset.php
+++ b/typo3/sysext/backend/Classes/Authentication/PasswordReset.php
@@ -352,7 +352,7 @@ class PasswordReset implements LoggerAwareInterface
 
         $this->invalidateUserSessions($userId);
 
-        $this->logger->info('Password reset successful for user {user_id)', ['user_id' => $userId]);
+        $this->logger->info('Password reset successful for user \'{username}\'', ['username' => $user['username'], 'user_id' => $userId]);
         $this->log(
             'Password reset successful for user %s',
             SystemLogLoginAction::PASSWORD_RESET_ACCOMPLISHED,
-- 
GitLab