这是当用户单击html页面中的按钮时调用的函数。
此函数在auth.js中,在server.js页面中调用
auth.js
const firebase = require("firebase");
static googleSignIn(req,res){
firebase.auth().signInWithPopup(new firebase.auth.GoogleAuthProvider()).
then( (result) => {
console.log(result.credential.idToken);
firebase.auth().currentUser.getIdToken(true).then( (token) => {
console.log(token);
});
}).catch((err) => {
console.log(err);
});
}
我收到此错误
code: 'auth/operation-not-supported-in-this-environment',
message:
'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
有什么方法可以发送html请求并获得令牌作为响应,或者有其他方法。请帮助