小编Ala*_*wer的帖子

在Firebase中处理链接帐户

我正在遵循Firebase的社交登录说明。下面是我正在使用的示例,从登录身份验证角度来看,它们都可以正常工作。

但是,我有Google和Facebook登录独立工作。

我现在想做的是链接帐户。实际上,您可以在下面看到它的去向(请参阅注释):

如果您在应用程序上使用多个身份验证提供程序,则应在此处处理用户帐户的链接。

我已经尝试了许多我认为应该在此处进行的修改,但均无济于事。有人可以指导我有关他们认为应该去这里的事情吗?谢谢!

function initFBApp() {
    // Result from Redirect auth flow.
    // [START getidptoken]
    firebase.auth().getRedirectResult().then(function (result) {
        if (result.credential) {
            // This gives you a Facebook Access Token. You can use it to access the Facebook API.
            var token = result.credential.accessToken;
            // [START_EXCLUDE]
            document.getElementById('FBquickstart-oauthtoken').textContent = token;
        }
        else {
            document.getElementById('FBquickstart-oauthtoken').textContent = 'null';
            // [END_EXCLUDE]
        }
        // The signed-in user info.
        var user = result.user;
    }).catch(function (error) {
        // Handle Errors here.
        var errorCode …
Run Code Online (Sandbox Code Playgroud)

javascript social facebook-login firebase firebase-authentication

6
推荐指数
1
解决办法
3316
查看次数