[英]Option of create multiple accounts for each identity provider not working as expected in Firebase Authentication
要將多個提供商鏈接到同一個帳戶,您不使用 create user 方法,有一個鏈接方法:
https://firebase.google.com/docs/auth/web/account-linking
import { getAuth, linkWithCredential } from "firebase/auth";
const auth = getAuth();
linkWithCredential(auth.currentUser, credential)
.then((usercred) => {
const user = usercred.user;
console.log("Account linking success", user);
}).catch((error) => {
console.log("Account linking error", error);
});
基本上,行為是該帳戶已創建並已登錄,然后您可以將其現有帳戶與新的提供商鏈接。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.