how to send verification mail in firebase and forg

2019-08-02 02:39发布

问题:

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

回答1:

Looking at current master, I don't think it is implemented yet. Perhaps file a feature request in flutter issue tracker?



回答2:

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.
});


回答3:

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(...);