我正在尝试使用 firebase admin SDK 来链接电子邮件/密码登录方法。
根据 firebase 文档,我们可以将用户链接到特定的提供商https://firebase.google.com/docs/reference/admin/node/firebase-admin.auth.updaterequest.md#updaterequestprovidertolink
基于我正在使用的:
await admin
.auth()
.updateUser(user.uid, {
providerToLink: {
uid: user.email,
email: user.email,
displayName: user.displayName,
providerId: 'password',
},
})
.catch((error: any) => {
console.error(`${error}`);
});
Run Code Online (Sandbox Code Playgroud)
它应该将电子邮件/密码登录方法链接到特定用户,但它不是返回错误
auth/invalid-provider-idThe providerId must be a valid supported provider identifier string.facebook.com或时它按预期工作google.com问题
我是否应该使用另一个提供程序 ID 来链接电子邮件/密码登录方法?
我是否应该使用另一种方法来链接电子邮件/密码登录方法?
节点版本:12
firebase-管理员:9.12.0