【发布时间】:2019-06-28 03:39:32
【问题描述】:
我想知道如何在我的 react-native 项目中重置 firebase 电子邮件身份验证密码的密码。我喜欢发送电子邮件重置密码。如何使用以下方法做到这一点
firebase.auth().sendPasswordResetEmail
【问题讨论】:
标签: firebase react-native firebase-authentication react-native-android
我想知道如何在我的 react-native 项目中重置 firebase 电子邮件身份验证密码的密码。我喜欢发送电子邮件重置密码。如何使用以下方法做到这一点
firebase.auth().sendPasswordResetEmail
【问题讨论】:
标签: firebase react-native firebase-authentication react-native-android
forgotPassword = (Email) => {
firebase.auth().sendPasswordResetEmail(Email)
.then(function (user) {
alert('Please check your email...')
}).catch(function (e) {
console.log(e)
})
}
应该为这种忘记密码的方法发送一封电子邮件。
【讨论】:
我认为上面的答案是旧版本,对我来说它不起作用...... 试试这个方法
import {signInWithEmailAndPassword, sendPasswordResetEmail,} from firebase/auth";
import { auth, } from "../config/firebase";
const forgotPassword = (Email) => {
console.log("reset email sent to " + Email);
sendPasswordResetEmail(auth, Email, null)
.then(() => {
alert("reset email sent to " + Email);
})
.catch(function (e) {
console.log(e);
});
};
这对我有用...
【讨论】: