Skip to content

Commit cd22c52

Browse files
committed
Merge branch '5.1' into 5.2
* 5.1: [Security] Replace message data in JSON security error response [DI] Skip deprecated definitions in CheckTypeDeclarationsPass [Messenger][AmazonSqs] Fix auto-setup for fifo queue [DoctrineBridge] Take into account that indexBy="person_id" could be a db column name, for a referenced entity
2 parents 7a46392 + a752155 commit cd22c52

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Firewall/UsernamePasswordJsonAuthenticationListener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,10 @@ private function onFailure(Request $request, AuthenticationException $failed): R
188188
}
189189

190190
if (!$this->failureHandler) {
191-
$errorMessage = $failed->getMessageKey();
192-
193191
if (null !== $this->translator) {
194192
$errorMessage = $this->translator->trans($failed->getMessageKey(), $failed->getMessageData(), 'security');
193+
} else {
194+
$errorMessage = strtr($failed->getMessageKey(), $failed->getMessageData());
195195
}
196196

197197
return new JsonResponse(['error' => $errorMessage], 401);

0 commit comments

Comments
 (0)