【发布时间】:2020-04-17 12:08:42
【问题描述】:
我想实现一个重置密码表单。为此,我需要检查用户 input 在 out 文本字段中的文本输入电子邮件是否存在于我们的 firebase 身份验证数据库中,以便我可以发送重置密码邮件或向他展示用于纠正电子邮件的弹出对话框。
我已经应用了电子邮件检查部分,我检查文本是否为电子邮件。
【问题讨论】:
标签: firebase flutter dart firebase-authentication reset-password
我想实现一个重置密码表单。为此,我需要检查用户 input 在 out 文本字段中的文本输入电子邮件是否存在于我们的 firebase 身份验证数据库中,以便我可以发送重置密码邮件或向他展示用于纠正电子邮件的弹出对话框。
我已经应用了电子邮件检查部分,我检查文本是否为电子邮件。
【问题讨论】:
标签: firebase flutter dart firebase-authentication reset-password
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 方法。
【讨论】: