<?phpnamespace App\EventListener;use Lexik\Bundle\JWTAuthenticationBundle\Event\AuthenticationFailureEvent;use Symfony\Component\HttpFoundation\JsonResponse;class AuthenticationFailureListener{ public function onAuthenticationFailure(AuthenticationFailureEvent $event): void { $data = [ 'success' => false, 'message' => 'Identifiants invalides', 'error' => 'Authentication failed' ]; error_log("AuthenticationFailureListener: Échec de connexion - " . $event->getException()->getMessage()); $response = new JsonResponse($data, JsonResponse::HTTP_UNAUTHORIZED); $event->setResponse($response); }}