【发布时间】:2019-07-05 06:54:20
【问题描述】:
我将 Firebase-auth 用于我正在使用电子框架开发的 Web 应用程序。我使用项目设置创建了一个 API 密钥,并按照 Firebase 指南中的建议将其复制到我的 html 正文中。但是,当我在浏览器上打开 HTML 页面时,控制台显示以下错误。
code: "auth/invalid-api-key"
message: "Your API key is invalid, please check you have copied it correctly."
__proto__: Error
HTML页面正文的底部如下。
<script src="https://www.gstatic.com/firebasejs/5.8.2/firebase.js"></script>
<script>
// Initialize Firebase
var config = {
apiKey: "AIzaSyAXXXXXXXXXXXXXXXXXXXXjILO32ZDxRKY",
authDomain: "jumbleup-773da.firebaseapp.com",
databaseURL: "https://jumbleup-773da.firebaseio.com",
projectId: "jumbleup-773da",
storageBucket: "jumbleup-773da.appspot.com",
messagingSenderId: "971123072180"
};
firebase.initializeApp(config);
</script>
注意:我通过将 20 位数字更改为 X 来混淆真正的密钥。
【问题讨论】:
-
它是你主进程中的脚本吗?
-
我在 index.html 中使用了这段代码,而 index.html 又调用了 renderer.js
-
尝试在render.js中写入并将这个js文件追加到index.html中
标签: javascript typescript firebase firebase-authentication electron