使用Firebase身份validation和Express身份validation社交login?

我对Firebase颇为陌生,对Express也稍微有点新,而且我很难尝试使用Firebase提供的身份validationstream程。

我有这个路由,但每次我点击触发路由的button,我得到这个错误This operation is not supported in the environment this application is running on. "location.protocol" must be http, https or chrome-extension and web storage must be enabled. This operation is not supported in the environment this application is running on. "location.protocol" must be http, https or chrome-extension and web storage must be enabled.

我很确定networking存储已启用,但我很不确定如何修复location.protocol 。 我究竟做错了什么?

路线如下:

 app.get('/auth/facebook', function(req, res) { const provider = new firebase.auth.FacebookAuthProvider(); firebase.auth().signInWithPopup(provider) .catch(err => console.log(err)); }); 

这里是完整的Firebase应用程序

试试这段代码。

 var provider = new firebase.auth.FacebookAuthProvider(); Auth.$signInWithPopup(provider).then(function(authData) { // success }).catch(function(error) { // error });