how to send verification mail in firebase and forgot password link in firebase flutter version

Viewed 5538

how to send verification mail in firebase and forgot password link in firebase flutter version

firebase_auth plugin I don't found any forgot password method is there any other way for both

3 Answers

fire base is providing the option to reset the password of the user this query will send a url for reseting the password to user mail id

var auth = firebase.auth();
var emailAddress = "<Mail_id >";

auth.sendPasswordResetEmail(emailAddress).then(function() {
  // Email sent.
    console.log("welcome")
}).catch(function(error) {
  // An error happened.
});

The method is available in the FirebaseUser, not FirebaseAuth (_auth).

await _auth.createUserWithEmailAndPassword(
  email: _userEmail,
  password: _userPassword
).then((FirebaseUser user) {
  // upon success, send email verification
  user.sendEmailVerification();  
  ...
})
.catchError(...);
Related