FireBase Auth注销:PlatformException(FirebaseException,用户已链接到给定的提供程序。,null)

时间:2019-11-03 13:06:03

标签: firebase authentication flutter firebase-authentication

我正在为用户执行Firebase身份验证。我同时使用google和电话登录。用户已成功通过身份验证并如此登录。

enter image description here

但是当我从应用程序注销时,尝试再次使用相同的google和电话登录,它会告诉我-

  

无法验证SMS代码:PlatformException(FirebaseException,用户   已链接到给定的提供程序。,空)

我已使用以下代码从应用程序注销。

FlatButton(
              child: Text("Sign out", style: theme.textTheme.button),
              onPressed: () async {
                await GoogleSignIn().signOut();             
                await FirebaseAuth.instance.signOut();

              },
            )

1 个答案:

答案 0 :(得分:1)

好吧,可以通过从firebase身份验证控制台删除firebase用户来解决此问题。

希望我在Firestore数据库中拥有与该帐户相关联的数据,当他尝试过一段时间后尝试登录并通过搜索键(电话号码)来检索其先前的数据时,我曾经对该用户再次进行身份验证。

final FirebaseUser firebaseUser;
final GoogleSignInAccount googleUser;
 onPressed: () async {
                await GoogleSignIn().signOut();
                googleUser.clearAuthCache();
                print('SignedOut');
                await firebaseUser.delete();
                await FirebaseAuth.instance.signOut();                
                print('signedOut from FireBase');                
              }

此问题已得到解决,对与用户链接的数据没有任何可能的损坏。