I'm using firebase ver 3.2.1 in my React Native iOS project. I read the log from version 2.4.2 here, there is a method named changePassword() which can be used to change user's password.
But when I look docs for Firebase ver 3.2.1 I can't find any method named changePassword(). So I'm wondering, is changePassword() method can not be used in Firebase version 3 anymore?
Thanks.
Since Firebase v3.0, changePassword
method is not available anymore. If you need to reset your user's password you can use custom email action handlers : https://firebase.google.com/docs/auth/custom-email-handler
The following user management actions require the user to complete the action using an email action handler: Resetting passwords
I recommend you read the documentation and you'll get started really quick to reset your user's password.
EDIT : If you don't need to reset the password but just update it, you can use the updatePassword
method.
let user = firebase.auth().currentUser;
let newPassword = getASecureRandomPassword();
user.updatePassword(newPassword).then(() => {
// Update successful.
}, (error) => {
// An error happened.
});
Important: To set a user's password, the user must have signed in recently. See Re-authenticate a user.
More informations here : https://firebase.google.com/docs/auth/web/manage-users#set_a_users_password
Hope this helps !
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With