I’m trying to implement reCAPTCHA v3 in my project, in the login. I would like to implement something additional like “verify the response token” to check if it’s successful, the score for this request (0.0 – 1.0), etc.
This is my grecaptcha.execute
$(document).ready(function() {
$('#idEntrar').click(function() {
grecaptcha.ready(function() {
grecaptcha.execute('myKEY :)', {
action: 'validarUsuario'
}).then(function(token) {
//agregamos un elemento de tipo oculto al formulario
$('#loginModal').prepend('<input type="hidden" name="token" value="' + token + '" >');
$('#loginModal').prepend('<input type="hidden" name="action" value="validarUsuario" >');
//lo enviamos
$('#loginModal').submit();
});
});
})
})
I’ts working well, return the “request” in Mozilla like this:
action: “validarUsuario”
tokken: “the token”
UsuarioTxt: “user”
PasswordTxT: “password”
And now, I don’t know how do I return the response “Site Verify Response”
{
"success": true|false, // whether this request was a valid reCAPTCHA token for your site
"score": number // the score for this request (0.0 - 1.0)
"action": string // the action name for this request (important to verify)
"challenge_ts": timestamp, // timestamp of the challenge load (ISO format yyyy-MM-dd'T'HH:mm:ssZZ)
"hostname": string, // the hostname of the site where the reCAPTCHA was solved
"error-codes": [...] // optional
}
I hope you can understand what I’m trying to say, it would help me a lot, thanks for your time!!! 🙂