Invisible Recaptcha data-callback function no longer being called!

358 views
Skip to first unread message

Anonymous Platypus

unread,
Jul 11, 2017, 5:03:50 AM7/11/17
to reCAPTCHA
I have a considerably large web app that makes use of Invisible ReCaptcha. The feature worked about 2 weeks ago but seems to have stopped working as of now.

The program makes use of Angular and CoffeeScript on the front-end and ASP.NET MVC5 on the back-end.

The g-recaptcha class is on a button. It calls an onSubmit function in the CoffeeScript. An example of the code is below:

<button class="btn btn-success g-recaptcha" data-sitekey="site_key_here" data-callback="onSubmit">
         
<i class="fa fa-fw fa-refresh"></i>&nbsp;&nbsp;DO SOMETHING
</button>

I had to be quite hacky with the front to back-end code:

$window.onSubmit = (_token) ->    
  console
.log "Trying reCaptcha"    
  $http
.post "/api/captcha", null, headers: {"reCaptchaToken" : _token}      
   
.then (res) ->        
      console
.log "reCaptcha returned: ", res.data        
     
if res.data == "Success"          
        console
.log "Worked fine"          
       
#DO STUFF        
     
else
        grecaptcha
.reset()      
   
.catch () ->        
     console
.log "reCaptcha failed"

I even tried putting a function in the HTML to check if the data-callback was firing:

<script>
 
function onSubmit(token) {
    console
.log("Callback fired!")
 
}
</script>

Not getting anything back in the console.

If anyone has any ideas please share as I am at a loss and was hoping to take this feature live quite soon.

P.S. I am the juniorest of juniors and 100% open to any constructive criticism.

Anonymous Platypus

unread,
Jul 11, 2017, 12:14:56 PM7/11/17
to reCAPTCHA
I should add it is Angular 1.4
Reply all
Reply to author
Forward
Message has been deleted
0 new messages