Firebase reset password using provider accounts

↘锁芯ラ 提交于 2019-12-20 06:34:11

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!