问题
I copied the code from this bit here in the documentation:
window.recaptchaVerifier.render().then(function(widgetId) {
grecaptcha.reset(widgetId);
}
However in my react project grecaptcha
is undefined. I don't see where they declare it as a variable or where to get it from in firebase.
回答1:
Not sure why but this worked for me just fine:
window.recaptchaVerifier.render().then(widgetId => {
window.recaptchaVerifier.reset(widgetId);
});
Instead of doing grecaptcha
, I just did the window.recaptchaVerifier
and it worked like a charm.
来源:https://stackoverflow.com/questions/48789732/firebase-grecaptcha-is-undefined-with-react