【发布时间】:2019-07-20 00:44:01
【问题描述】:
在 ElectronJS 上使用 Google 测试 Firebase 身份验证后遇到错误。
身份验证以前可以工作,尽管我没有对我的代码进行任何会影响 Google 身份验证部分的重大更改。
当我在浏览器中运行我的项目时,身份验证仍然可以正常工作(npm run serve)。在 Electron 中,我可以看到
TypeError: Cannot create property 'href' on string 'about:blank' when clicking on the Google authentication button.
TypeError: Cannot create property 'href' on string 'about:blank'
我的代码在点击时被执行 -
googleLogin() {
fb.auth
.signInWithPopup(fb.googleProvider)
.then(credential => {
this.$store.commit("setCurrentUser", credential.user)
fb.usersCollection.doc(credential.user.uid).set({
}).then(() => {
this.$store.dispatch("fetchUserProfile")
this.updateGmailData()
this.$router.push("/dashboard")
}).catch(err => {
console.log(err)
})
}).catch(err => {
console.log(err);
});
},
第二次点击按钮,我可以看到另一个 typeError -
TypeError: Cannot create property 'href' on string ''
为什么身份验证在浏览器中有效,但在 Electron 中无效? 这个问题的原因是什么?
【问题讨论】:
标签: firebase vue.js firebase-authentication electron