I am trying to follow the instructions for reCAPTCHA v3 but can't seem to get even the basics down. Seems like the grecaptcha execute is returning a very strange, unusable result. I am testing this on localhost:7684
<script src='https://www.google.com/recaptcha/api.js?render=MYSITEKEY'>
</script>
<script>
grecaptcha.ready(function() {
grecaptcha.execute('MYSITEKEY', {action:
'action_name'}).then(function(token) {
console.log(token);
alert(token);
});
});
</script>
<form action="http://localhost:7684/botcheck" method="post">
<input type="text" name="name" value="" placeholder="name" required />
<button type="submit">submit</button>
</form>
The console is showing the token is null, and my chrome debugger is showing this response:
)]}'
["rresp",null,null,null,null,null,10]
chrome dev tools
Ok, that was stupid. The problem was I had to change the action parameter to anything else. Looks like they return that result for the default action name "action_name"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With