From https://firebase.google.com/docs/auth/web/phone-auth:
If signInWithPhoneNumber results in an error, reset the reCAPTCHA so the user can try again:
grecaptcha.reset(window.recaptchaWidgetId); // Or, if you haven't stored the widget ID: window.recaptchaVerifier.render().then(function(widgetId) { grecaptcha.reset(widgetId); }
But grecaptcha
is never defined. Do I have to import it from somewhere?
Looks like it is automatically imported by firebase. However, because I was compiling code from ES2015 I needed to add
/* global grecaptcha */
to the top of my js file to make it visible by my code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With