react-google-recaptcha icon indicating copy to clipboard operation
react-google-recaptcha copied to clipboard

Recaptcha breaks after an expiration event

Open maddie927 opened this issue 10 years ago • 4 comments

  1. Load page
  2. Check box
  3. Wait for expiration
  4. Try to click the box again or reset it manually
  5. Error inside the recaptcha script: image

Any ideas if something related to the async script loading might be causing this? I've tried specifying an expiration callback as well but it behaves the same. Once it expires the recaptcha is unusable until the page is refreshed.

maddie927 avatar Sep 16 '15 22:09 maddie927

I was able to work around this by completely removing and rebuilding the component on expiration, so if this is Google's fault then this can be closed.

maddie927 avatar Sep 16 '15 22:09 maddie927

I'll look into it

dozoisch avatar Sep 17 '15 14:09 dozoisch

For me, the error was "TypeError: this is undefined" at

    if (this.props.onExpired) {
      this.props.onExpired();
    } else if (this.props.onChange) {
      this.props.onChange(null);
    }
  };

ghost avatar Apr 23 '17 13:04 ghost

Hey! As I also encountered some issues with this lib and couldn't solve it in a clean way so I decided to create my own library. It has some improvements comparing to this and most important - it works completely fine! 🚀 And what's most awesome - it's more a React-way of doing things, without assigning variables outside the component. Handling expiration event works pretty fine - I'm fresh after testing it. Check it out on the example page if you're interested 😄

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

jsardev avatar Jun 13 '18 20:06 jsardev