javascript - 新 iframe 的非法网址
问题描述
我想为我的 firebase 项目使用 google 登录按钮;但是当我按下 google 登录按钮时,我收到此错误:
未捕获的错误:新 iframe 的非法 URL
我的代码在这里:
TY 为您提供帮助。
firebase.initializeApp({
apiKey: '***',
authDomain: 'https://***.firebaseapp.com',
projectId: '***'
});
var ui = new firebaseui.auth.AuthUI(firebase.auth());
var uiConfig = {
callbacks: {
signInSuccessWithAuthResult: function(authResult, redirectUrl) {
return true;
},
uiShown: function() {
document.getElementById('loader').style.display = 'none';
}
},
signInFlow: 'popup',
signInSuccessUrl: 'https://***.web.app/',
signInOptions: [
firebase.auth.GoogleAuthProvider.PROVIDER_ID
],
// Terms of service url.
tosUrl: 'https://***.web.app/',
// Privacy policy url.
privacyPolicyUrl: 'https://***.web.app/'
};
ui.start('#firebaseui-auth-container', uiConfig);
<script src="https://www.gstatic.com/firebasejs/7.4.0/firebase.js"></script>
<script src="https://www.gstatic.com/firebasejs/ui/4.8.0/firebase-ui-auth.js"></script>
<link type="text/css" rel="stylesheet" href="https://www.gstatic.com/firebasejs/ui/4.8.0/firebase-ui-auth.css" />
<h1>Welcome to My Awesome App</h1>
<div id="firebaseui-auth-container"></div>
<div id="loader">Loading...</div>
解决方案
我解决了我的问题。
firebase.initializeApp({
apiKey: ' ', authDomain: 我编辑这个->>>> ' .firebaseapp.com', projectId: '***' });
我只是删除-> https://
推荐阅读
- python - 如何删除一个numpy数组:追逐内存增长
- php - 在 EasyAdmin 3.x 上使用验证组
- python - 将预先录制的音频播放到由 simcom 创建的语音通话中
- python - Python。如何在网站上进行身份验证?
- r - 如何在 R 中绘制离散密度函数
- javascript - 自动记录从文档到表格的字数
- arrays - Numpy Array - 使用一个热编码列的总和进行高级切片
- list - haskell 函数获取整数或字符串列表并返回整数列表
- go - librdkafka 和 confluent-kafka-go 是否支持基于 JKS 的 SSL 配置?
- html - 如何更改导航栏每个链接的颜色?