how to reset firebase auth password in react native
Solution 1:
forgotPassword = (Email) => {
firebase.auth().sendPasswordResetEmail(Email)
.then(function (user) {
alert('Please check your email...')
}).catch(function (e) {
console.log(e)
})
}
An email should be passed for this forgot password method.
Solution 2:
i think the answer above is old version, for me it doesn't work... try that way
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);
});
};
that's what works for me...