Closed phoenix741 closed 3 years ago
If i use V3 reCaptcha and set an action_name:
->add( 'recaptcha', EWZRecaptchaV3Type::class, array( 'mapped' => false, 'action_name' => 'contact', 'constraints' => array( new IsTrueV3() ) ) );
When i validate the formulaire i have an error that say i should check "I'm not a robot" (the case is not present in v3)
The reason is in the file Validator\Constraints\IsTrueValidatorV3.php. The method isTokenValid check only if action is form :
Validator\Constraints\IsTrueValidatorV3.php
/** * @param string $token * * @return bool */ private function isTokenValid($token) { try { $remoteIp = $this->requestStack->getCurrentRequest()->getClientIp(); $recaptcha = new ReCaptcha($this->secretKey); $response = $recaptcha ->setExpectedAction('form') ->setScoreThreshold($this->scoreThreshold) ->verify($token, $remoteIp);
Thanks.
Same problem here.
I created pull request #263
If i use V3 reCaptcha and set an action_name:
When i validate the formulaire i have an error that say i should check "I'm not a robot" (the case is not present in v3)
The reason is in the file
Validator\Constraints\IsTrueValidatorV3.php
. The method isTokenValid check only if action is form :Thanks.