Electron App中的Firebase Google Auth给出“ location.protocol”必须为http,https

时间:2018-06-30 03:27:46

标签: firebase firebase-authentication electron

<button id="signin_with_google_button">sign in</button>
<script>
  var firebase = require("firebase");
  var config = {
    apiKey: "AIzaSyAwp7hhcZGyNfZOY8AOeIrpzkzL69quiS0",
    authDomain: "https://sdsdss-efefx22.firebaseapp.com",
    databaseURL: "https://sdsdss-efefx22.firebaseio.com",
    projectId: "sdsdss-efefx22",
    storageBucket: "sdsdss-efefx22.appspot.com",
    messagingSenderId: "3232323"
  };
  firebase.initializeApp(config);
  var provider = new firebase.auth.GoogleAuthProvider();
  document.querySelector('#signin_with_google_button')
          .addEventListener('click', () => {
      firebase.auth().signInWithPopup(provider).then(function(result){  
        console.log("Google result", result);
      }).catch(function(error) {
         console.log("Google Error", error);
      });
  });
</script>
  

此应用程序所在的环境不支持此操作   继续前进。 “ location.protocol”必须为http,https或   必须启用chrome扩展名和网络存储。

https://firebase.google.com/docs/auth/web/google-signin

firebase版本:

"firebase": "4.6.2",

PS:我经历了location.protocol" must be http or https 但似乎没有人建议对电子有任何解决方法。

更新

尝试了隐式电子邮件身份验证,它按照建议的here

工作

但是here解释说,firebaseui仍无法在没有得到官方支持的电子中工作。即使它没有得到官方支持,但我肯定会有解决方法,让人们可以提出解决方法。

0 个答案:

没有答案