Reputation: 505
The existing user has trouble signing in and wants to reset the password. She doesn’t receive any reset password emails. We also tried to send the reset email through Firebase Console
but no luck - no emails got delivered.
Is there any way to set a password manually through Firebase console
or any other workaround?
Thanks!
Upvotes: 1
Views: 2420
Reputation: 505
Issue got resolved. SendGrid (service that Firebase uses to send emails) had some maintenance during 8 hours in Asia region (my user is from Asia region) that's why it was working for me and not working for her.
Check SendGrid status URL: http://status.sendgrid.com
Thanks for all your suggestions!
Upvotes: 1
Reputation: 1194
Upvotes: 1
Reputation: 598728
You can set the user's password through Firebase's Admin SDKs. These SDKs run with administrative privileges, so should only be run in a trusted environment such as your development machine, a server you control, or Cloud Functions.
This is an example of setting a user's password with Node.js:
admin.auth().updateUser(uid, { password: "newPassword" })
For more samples (including in other supported languages), see the documentation on updating a user profile.
Upvotes: 2
Reputation: 1194
You can set a user's password with the updatePassword
method and send "SOME-SECURE-PASSWORD" :)
For example:
FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
String newPassword = "SOME-SECURE-PASSWORD";
user.updatePassword(newPassword)
.addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
if (task.isSuccessful()) {
Log.d(TAG, "User password updated.");
}
}
});
Upvotes: 0