Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Reset Password Swift [closed]

I was wondering if you guys could show me how to setup Reset Password in Swift, I am currently using Firebase as my backend service. I just need the code.

like image 453
Tyge Avatar asked Mar 05 '16 00:03

Tyge


People also ask

How do I reset my firebase authentication password?

To send a password reset email to user, on the Users page, hover over the user and click ... > Reset password. The user will receive an email with instructions on how to reset their password.

How do I change my firebase password?

One way to allow your users to change their password is to show a dialog where they enter their current password and the new password they'd like. You then sign in (or re-authenticate) the user with the current passwordand call updatePassword() to update it.

How do I find my firebase password?

Finding the Password Hash Parameters To access these parameters, navigate to the 'Users' tab of the 'Authentication' section in the Firebase Console and select 'Password Hash Parameters' from the drop down in the upper-right hand corner of the users table.


1 Answers

The answer is in the API documentation:

-sendPasswordResetWithEmail:completion:

Initiates a password reset for the given email address.

See FIRAuthErrors for a list of error codes that are common to all API methods.

In Swift 3.x and Firebase 3.x it will look like this:

FIRAuth.auth()?.sendPasswordReset(withEmail: "email@email") { error in
    // Your code here
}

Edit:

Firebase 4 changed the Firebase functions to be more aligned with the naming conventions in Swift.

Auth.auth().sendPasswordReset(withEmail: "email@email") { error in
    // Your code here
}
like image 60
Jay Avatar answered Oct 03 '22 23:10

Jay