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

问题描述 投票:0回答:1

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

enter image description here

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

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

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

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

              },
            )
firebase authentication flutter firebase-authentication
1个回答
0
投票

嗯,通过从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');                
              }

此问题已解决,对与用户链接的数据没有任何易受破坏。

我很高兴!

© www.soinside.com 2019 - 2024. All rights reserved.