且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Firebase身份验证链接错误-用户只能链接到给定提供者的一个身份

更新时间:2023-12-05 17:16:04

您不能链接2个现有的Firebase用户.您只能将新凭据链接到现有用户. 在注册用户时,应仅使用电子邮件/密码凭据对匿名用户使用currentUser.linkWithCredential,而无需先调用createUser.这基本上是将匿名用户升级为电子邮件/密码用户.

You can't link 2 existing Firebase users. You can only link a new credential to an existing user. When you are registering the user, you should just currentUser.linkWithCredential on the anonymous user using the email/password credential without calling createUser first. This is basically upgrading the anonymous user to an email/password user.