Not able to know when user is identified as a bot in google invisible captcha on client side

Viewed 37

I am following Programmatically invoke challenge process for identifying a user as human or 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 data callback function in my html script tag:

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

data callback gets invoked every time when google identifies a user as human successfully.

it does not get invoked when google identifies a user as a bot.

but i want to know when google identifies user a bot in above similar way on clicking a button?

because when i click on a button, i programmatically invoke challenge by grecaptcha.execute() so this happens:

1) if user is validated as human , data-callback is called and i do my next processing with token.but 2) if user is not validated as human, data-callback is not called and nothing happens on click and i stay on same page.

i expect acknowledgment here in second case so that i can decide further processing.

please help me in this.

0 Answers
Related