首页 > 解决方案 > 新 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>

标签: javascriptfirebasefirebase-authenticationgoogle-signin

解决方案


我解决了我的问题。

firebase.initializeApp({

apiKey: ' ', authDomain: 我编辑这个->>>> ' .firebaseapp.com', projectId: '***' });

我只是删除-> https://


推荐阅读