问题
I am using firebase for a little while and I find a little issue I think it's not a big issue, that issue is that when I login with provider account like: "facebook" account and I enter facebook account email in forgot password field this should show an error but what happens is that the method success, my question is that when I reset password is my facebook account password changed or what happens, heres my method below:
mAuth.sendPasswordResetEmail(Email).addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
if (task.isSuccessful()){Toast.makeText(forgot.this,"Send",Toast.LENGTH_SHORT).show();mProgress.hide();}
else {Toast.makeText(forgot.this,"Not send",Toast.LENGTH_SHORT).show();mProgress.hide();}}});}
I need a method that check if user email is an provider email like "facebook,twitter and google" and return.
So any help brothers.
回答1:
If you need an API to check what type of provider is associated with an email, you can use fetchProvidersForEmail. https://firebase.google.com/docs/reference/android/com/google/firebase/auth/FirebaseAuth.html#fetchProvidersForEmail(java.lang.String)
As for resetting the password of an account that had a Facebook provider linked to it, it will unlink that Facebook account and transform it into a password account. The user will need to re-link the Facebook provider. This behavior allows the user to recover an account in case it was hijacked and modified by another unverified user.
来源:https://stackoverflow.com/questions/44678796/firebase-reset-password-using-provider-accounts