appleboy / react-recaptcha

A react.js reCAPTCHA for Google
https://www.google.com/recaptcha/intro/index.html
BSD 3-Clause "New" or "Revised" License
635 stars 97 forks source link

verifyCallback callback isn't being called the first time you make the request. #242

Open anmol5varma opened 6 years ago

anmol5varma commented 6 years ago

A weird behaviour is happening as the first time I use captcha the callback isn't being called and hence no gResponse is sent and login fails. From the second request onwards it works fine.

jsardev commented 6 years ago

I've also had many problems with this lib so I've created my own one. You can check it out, it works pretty well and has some cool improvements comparing to this one. If you'll lack anything there, just file an issue - I'll try to fix it as soon as possible. 🚀

Library: https://github.com/sarneeh/reaptcha Example: https://sarneeh.github.io/reaptcha/

mattlockyer commented 5 years ago

It only works with explicity rendering, you need to specify

...
render="explicit"
onloadCallback={() => console.log('rendered')}
...

Not making excuses, putting here to help others.

Library needs better documentation!

ElForastero commented 5 years ago

onloadCallback maybe works, but I still have issues with verifyCallback even with explicit render option.

murtali commented 5 years ago

just having explicit render option is not enough -- you need the onloadCallback defined

...
render="explicit" // 
onloadCallback={() => console.log('rendered')} // required
verifyCallback={(response) => { // do something }}
...