throw RoutingException::
missingRequestParameter('formId'
);
} if ($this->basicCaptcha->
isValid($request,
[])) { $fakeSession =
$request->
get(BasicCaptcha::CAPTCHA_REQUEST_PARAMETER
);
$request->
getSession()->
set($formId . BasicCaptcha::BASIC_CAPTCHA_SESSION,
$fakeSession);
return new JsonResponse(['session' =>
$fakeSession]);
} $violations =
$this->basicCaptcha->
getViolations();
$formViolations =
new ConstraintViolationException($violations,
[]);
$response[] =
[ 'type' => 'danger',
'error' => 'invalid_captcha',
'input' =>
$this->
renderView('@Storefront/storefront/component/captcha/basicCaptchaFields.html.twig',
[ 'formId' =>
$request->
get('formId'
),
'formViolations' =>
$formViolations,
]),
];
return new JsonResponse($response);
}}