【问题标题】:How to check if a given email is present in firebase auth?如何检查给定的电子邮件是否存在于firebase auth中?
【发布时间】:2020-04-17 12:08:42
【问题描述】:

我想实现一个重置密码表单。为此,我需要检查用户 input 在 out 文本字段中的文本输入电子邮件是否存在于我们的 firebase 身份验证数据库中,以便我可以发送重置密码邮件或向他展示用于纠正电子邮件的弹出对话框。

我已经应用了电子邮件检查部分,我检查文本是否为电子邮件

【问题讨论】:

    标签: firebase flutter dart firebase-authentication reset-password


    【解决方案1】:

    Firebase Auth 实际上可以为您管理。只需像这样调用sendPasswordResetEmail() 方法:

    _auth.sendPasswordResetEmail(email: email)
            .then((void v) => {
              // password reset email sent successfully
            })
            .catchError((Error error) => {
              // There was an error verifying the email
              // Check the output of error.toString()
              // This is where you may want to show a pop-up dialog
            });
    

    如果电子邮件格式错误或电子邮件不存在于 Auth 数据库中,代码将始终执行 catchError 方法。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-06-12
      • 2019-07-15
      • 2019-01-10
      • 2017-02-26
      • 2011-04-17
      • 1970-01-01
      • 2022-08-03
      相关资源
      最近更新 更多