简体   繁体   English

登录后Firebase无法获取数据

[英]Firebase can't get data after login

Using the new version of Firebase 3.0.2. 使用新版本的Firebase 3.0.2。

Data can be passed through firebase to different clients when they are not logged in but once log in the logged in user can't get new data or send data. 当未登录但无法登录的用户无法获取新数据或发送数据时,数据可以通过Firebase传递给其他客户端。

Here is my logging in code.. 这是我的登录代码。

var login = function(event) {
    event.preventDefault()
    var email = $('#email').val();
    var password = $('#password').val();

    //sign in with firebase
    firebase.auth().signInWithEmailAndPassword(email, password).then(function() {

        //get the user
        var user = firebase.auth().currentUser;
        if(user) {
            console.log('user logged in');
        } else {
            console.log('user not logged in');
        }
    }).catch(function(error) {
        //handle error codes
    });
};

I'm not sure if this has to do with this error but also after log in I get the warning... 我不确定这是否与此错误有关,但在登录后也收到警告...

failed: WebSocket is closed before the connection is established.

Any help is much appreciated! 任何帮助深表感谢! Thanks! 谢谢!

The issue ended up being with Firebase itself. 问题最终归结于Firebase本身。 I contacted Firebase support and apparently it was an issue with converting the old Firebase project to the new Firebase console. 我联系了Firebase支持人员,显然这与将旧的Firebase项目转换为新的Firebase控制台有关。 Apparently they had too many people importing their projects sense the new Firebase just came out. 显然,他们导入项目的人太多了,感觉到新的Firebase刚问世。 They reverted my project back to the old console and then I imported it again. 他们将我的项目还原到旧的控制台,然后我再次导入了它。 Then everything worked. 然后一切正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM