Unable to know when user is identified as bot in google invisible captcha on client side

I am following a programmatic call to the invocation process to identify the user as a human or a bot.

below is my captcha div in html.

<div class="g-recaptcha"
          data-sitekey="<site_key>"
          data-callback="onSubmit"
          data-size="invisible">
    </div>

      

and i have a data callback function in html script tag:

var onSubmit = function(token){
  // do next processing with token
}

      

the data callback is called every time Google successfully identifies the user as a person.

it is not called when Google identifies the user as a bot.

but I want to know when google identifies the user as a bot in a similar way when a button is clicked?

because when I click on the button, I programmatically call the call grecaptcha.execute()

to make it happen:

1) if the user is verified as human the data callback is called and I do my next processing with token.but 2) if the user is not verified as human the data callback is not called and nothing happens when clicked and I stay on one page.

I am awaiting confirmation here in the second case so that I can decide further processing.

Please help me with this.

+3


source to share





All Articles