【问题标题】:How to resend SMS verification in firebase phone authentication in angular4?如何在angular4的firebase电话身份验证中重新发送短信验证?
【发布时间】:2019-01-13 02:42:01
【问题描述】:

我正在从事 angular 4 和 ionic 3 项目。在项目中,我为登录页面实现了firebase电话身份验证。当 OTP 过期/不正确时,我需要实现重新发送 otp 功能。如何在 Angular 4 中实现 firebase 的重新发送 otp 功能?

【问题讨论】:

    标签: angular firebase firebase-authentication ionic3


    【解决方案1】:

    您好@srujana,请查看Firebase OTP Docs!。

    grecaptcha.reset(window.recaptchaWidgetId);
    

    或者,如果您尚未存储小部件 ID:

    window.recaptchaVerifier.render().then(function(widgetId) { 
       grecaptcha.reset(widgetId);
    }
    

    如果这不起作用,请发布您用于发送 OTP 的代码部分以供参考。

    【讨论】:

    • 嘿@naveen,您提供的示例是关于“重置”重新捕获,问题是关于“重新发送”验证码
    • @DmytroTolkachov 当您重置 recapcha 并继续使用相同的代码发送 OTP 时,它将按预期工作。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-08-10
    • 2019-08-23
    • 2018-06-01
    • 2022-06-28
    • 2021-10-11
    • 2020-07-22
    相关资源
    最近更新 更多