ast*_*mme 7 javascript recaptcha firebase firebase-authentication
从https://firebase.google.com/docs/auth/web/phone-auth:
如果 signInWithPhoneNumber 导致错误,请重置 reCAPTCHA,以便用户可以重试:
Run Code Online (Sandbox Code Playgroud)grecaptcha.reset(window.recaptchaWidgetId); // Or, if you haven't stored the widget ID: window.recaptchaVerifier.render().then(function(widgetId) { grecaptcha.reset(widgetId); }
但从grecaptcha
未定义。我必须从某个地方导入它吗?
看起来它是由 firebase 自动导入的。但是,因为我是从 ES2015 编译代码,所以我需要添加
/* global grecaptcha */
Run Code Online (Sandbox Code Playgroud)
到我的 js 文件的顶部,使其在我的代码中可见。
归档时间: |
|
查看次数: |
1043 次 |
最近记录: |