@@ -113,21 +113,21 @@ public function changePassword(
113113
114114 if (!$ user || !$ user instanceof UserInterface) {
115115 $ userId = $ request ->query ->get ('userId ' );
116- error_log ("User not logged in. Received userId from query: " . $ userId );
116+ // error_log("User not logged in. Received userId from query: " . $userId);
117117
118118 if (!$ userId || !ctype_digit ($ userId )) {
119- error_log ("Access denied: Missing or invalid userId. " );
119+ // error_log("Access denied: Missing or invalid userId.");
120120 throw $ this ->createAccessDeniedException ('This user does not have access to this section. ' );
121121 }
122122
123123 $ user = $ userRepository ->find ((int )$ userId );
124124
125125 if (!$ user || !$ user instanceof UserInterface) {
126- error_log ("Access denied: User not found with ID $ userId " );
126+ // error_log("Access denied: User not found with ID $userId");
127127 throw $ this ->createAccessDeniedException ('User not found or invalid. ' );
128128 }
129129
130- error_log ("Loaded user by ID: " . $ user ->getId ());
130+ // error_log("Loaded user by ID: " . $user->getId());
131131 }
132132
133133 $ isRotation = $ request ->query ->getBoolean ('rotate ' , false );
@@ -216,11 +216,11 @@ public function changePassword(
216216 if ($ newPassword || $ confirmPassword || $ currentPassword ) {
217217 if (!$ userRepository ->isPasswordValid ($ user , $ currentPassword )) {
218218 $ form ->get ('currentPassword ' )->addError (new FormError (
219- $ this ->translator ->trans ('The current password is incorrect. ' )
219+ $ this ->translator ->trans ('The current password is incorrect ' )
220220 ));
221221 } elseif ($ newPassword !== $ confirmPassword ) {
222222 $ form ->get ('confirmPassword ' )->addError (new FormError (
223- $ this ->translator ->trans ('Passwords do not match. ' )
223+ $ this ->translator ->trans ('Passwords do not match ' )
224224 ));
225225 } else {
226226 $ user ->setPlainPassword ($ newPassword );
0 commit comments