Closed lassanadiakite closed 1 year ago
Have you found the solution ? If not on my side I've removed the property and constraint from entity to put it directly on the form and it solved the problem.
see the api method in the readme
you need to implement a javascript method
<script src="https://www.google.com/recaptcha/api.js?render=<siteKey>"></script>
<script>
const siteKey = '*****************-**-******-******';
//either on page load
grecaptcha.ready(function() {
grecaptcha.execute(siteKey, {
action: 'homepage'
}).then(function(token) {
//the token will be sent on form submit
$('[name="captcha"]').val(token);
//keep in mind that token expires in 120 seconds so it's better to add setTimeout.
});
});
//or on form post:
grecaptcha.ready(function() {
grecaptcha.execute(siteKey, {
action: 'homepage'
}).then(function(token) {
//submit the form
return http.post(url, {email, captcha: token});
});
});
</script>
Hello, I work in API mode on symfony 5 (ApiPlatform) with nuxtjs in Front. After implementing your bundle. I get as error:
The captcha value is missing
. Thank you for your reply.