Giter VIP home page Giter VIP logo

Comments (8)

cosmosgenius avatar cosmosgenius commented on July 30, 2024 8

There is a window.grecaptcha.ready which maybe better than using 500 ms delay.

from ember-g-recaptcha.

craig2017 avatar craig2017 commented on July 30, 2024 6

Ok, i had some free time today to fix this. It was just a race condition. Recaptcha seems to be initializing window.grecaptcha first and then making another call to load the rest of the data. I can try to do a PR if I'm allowed to fix it.

We just need to check if window.grecaptcha.render is set.

renderReCaptcha() {
    if (isNone(window.grecaptcha) || isNone(window.grecaptcha.render)) {
      later(() => {
        this.renderReCaptcha();
      }, 500);

from ember-g-recaptcha.

gabrielsimpsons avatar gabrielsimpsons commented on July 30, 2024 4

Make sure your application is not loading multiple times 'https://www.google.com/recaptcha/api.js

from ember-g-recaptcha.

craig2017 avatar craig2017 commented on July 30, 2024 1

I had this problem too at 0.4.0. I think the instructions have changed along the way. You are probably missing the jsUrl in your env file. I think the ?render=explicit is critical now.

I upgraded to 0.8.0 and added the jsUrl.

    // ...
 
    gReCaptcha: {
      jsUrl: 'https://www.google.com/recaptcha/api.js?render=explicit', // default
      siteKey: 'your-recaptcha-site-key'
    }
 
    // ...
  }```

from ember-g-recaptcha.

craig2017 avatar craig2017 commented on July 30, 2024 1

Actually, it was working, now it stopped again. I gave up and added the script tag to my head.

  <script src="https://www.google.com/recaptcha/api.js?render=explicit" async></script>

from ember-g-recaptcha.

craig2017 avatar craig2017 commented on July 30, 2024

Maybe... I just patched the existing code by adding || isNone(window.grecaptcha.render)

from ember-g-recaptcha.

Allerby avatar Allerby commented on July 30, 2024

I'm seeing this as well when rendering with Fastboot (window is not available on node).

from ember-g-recaptcha.

algodave avatar algodave commented on July 30, 2024

A quick fix for this is in #11 so I can close this - thanks @craig2017 👍

However, a better solution seems to be the one suggested by @cosmosgenius - so I opened #13

from ember-g-recaptcha.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.