当前环境不支持指定的持久性types的Firebase

我得到这个错误。 “当前环境不支持指定的持久性types。” 我正在testing我的应用程序,并看到当用户login时,它的login到处。 所以我试图在node.js express上使用firebase实现会话,希望能够解决这个问题。 我的代码是这样的:

router.post("/login", function (req, res) { email = req.body.email; password = req.body.password; firebase.auth().setPersistence(firebase.auth.Auth.Persistence.SESSION); firebase.auth().signInWithEmailAndPassword(email, password).then(function () { var user = firebase.auth().currentUser; firebase.auth().onAuthStateChanged(function (user) { if (user) { res.redirect("/home"); } }); });}); 

node.js环境中仅支持none持久性(这是默认设置)。 这是因为,当在服务器环境中使用Firebase身份validation客户端库时,可能会有多个用户login,并且您没有持久保留在后端服务器上的currentUser的概念(这会导致一个用户打破另一个)。 会话持久性只能在客户端上修改。