Skip to content

Commit a752155

Browse files
committed
Merge branch '4.4' into 5.1
* 4.4: [Security] Replace message data in JSON security error response [DI] Skip deprecated definitions in CheckTypeDeclarationsPass [DoctrineBridge] Take into account that indexBy="person_id" could be a db column name, for a referenced entity
2 parents c25a04f + f0c28c7 commit a752155

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Firewall/UsernamePasswordJsonAuthenticationListener.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,9 @@ private function onFailure(Request $request, AuthenticationException $failed): R
182182
}
183183

184184
if (!$this->failureHandler) {
185-
return new JsonResponse(['error' => $failed->getMessageKey()], 401);
185+
$errorMessage = strtr($failed->getMessageKey(), $failed->getMessageData());
186+
187+
return new JsonResponse(['error' => $errorMessage], 401);
186188
}
187189

188190
$response = $this->failureHandler->onAuthenticationFailure($request, $failed);

0 commit comments

Comments
 (0)