使用提供程序帐户重置Firebase密码

问题描述:

我正在使用Firebase一段时间,但发现一个小问题,我认为这不是什么大问题,该问题是,当我使用提供者帐户(如"facebook"帐户)登录并输入Facebook帐户的电子邮件时,忘记了密码字段中应该显示一个错误,但发生的是该方法成功,我的问题是,当我重置密码时,我的facebook帐户密码已更改或发生了什么,这是我的方法,如下:

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();}}});}

我需要一种方法来检查用户电子邮件是否为提供者电子邮件(例如"facebook,twitter和google")并返回.

I need a method that check if user email is an provider email like "facebook,twitter and google" and return.

任何帮助兄弟.

如果您需要API来检查与电子邮件关联的提供商类型,则可以使用fetchProvidersForEmail. https ://firebase.google.com/docs/reference/android/com/google/firebase/auth/FirebaseAuth.html#fetchProvidersForEmail(java.lang.String)

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)

对于重置已链接了Facebook提供程序的帐户的密码,它将取消该Facebook帐户的链接并将其转换为密码帐户.用户将需要重新链接Facebook提供程序.这种行为使用户可以恢复帐户,以防其他未验证的用户劫持和修改了该帐户.

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.