I am actually develloping an iOS app in Swift which use Firebase as online Database. So the concept is : User can sign up with the firebase Authentification email and password then I write the email and the password in Database. But now, I wanted to implement a Reset mail password with Firebase Auth send password reset. This function work very well but I want to update the password in database too. I don't know to do it. Here is my code:
@IBOutlet weak var txt_mail: UITextField!
Auth.auth().sendPasswordReset(withEmail: txt_mail.text!) { (error) in
let alertController = UIAlertController(title: "Error", message: error?.localizedDescription, preferredStyle: .alert)
let defaultAction = UIAlertAction(title: "OK", style: .cancel, handler: nil)
alertController.addAction(defaultAction)
self.present(alertController, animated: true, completion: nil)
}
This code send reset email to user and user'll change his password from the link which send him by mail, how can I recover password?