我有很多种用户,一些用户是登录与谷歌帐户,其他人与谷歌帐户和密码,我只想发送重置邮件sendPasswordResetEmail,如果电子邮件属于用户有一个密码,而不是每种帐户,这每一个用户都要做的时候,用户不登录。
我使用了这个函数sendPasswordResetEmail,但是这个函数给每个人发邮件,我有一个没有密码的google帐户,这对我来说是错误的
发布于 2021-09-01 04:53:38
您可以检查用户的身份验证提供程序,并检查其中是否包含电子邮件密码:
const user = firebase.auth().currentUser;
if (user !== null) {
if (user.providerData.find(p => p.providerId === "password")) {
// user had email-password account
// send email
}
}https://stackoverflow.com/questions/69007917
复制相似问题