[Security] Replace message data in JSON security error response
This commit is contained in:
parent
8076c2f8ba
commit
ab2ca7145f
@ -191,7 +191,9 @@ class UsernamePasswordJsonAuthenticationListener extends AbstractListener implem
|
||||
}
|
||||
|
||||
if (!$this->failureHandler) {
|
||||
return new JsonResponse(['error' => $failed->getMessageKey()], 401);
|
||||
$errorMessage = strtr($failed->getMessageKey(), $failed->getMessageData());
|
||||
|
||||
return new JsonResponse(['error' => $errorMessage], 401);
|
||||
}
|
||||
|
||||
$response = $this->failureHandler->onAuthenticationFailure($request, $failed);
|
||||
|
Reference in New Issue
Block a user