Google Auth2 popup_closed_by_user

时间:2019-03-08 18:10:57

标签: javascript google-api google-oauth google-signin google-authentication

我有一个Google登录名,但出现此错误{error:“ popup_closed_by_user”}

这是我的代码:

const startApp = () => {
  gapi.load('auth2', function(){
    auth2 = gapi.auth2.init({
      client_id: 'CLIENT_ID',
      cookiepolicy: 'single_host_origin',
    })
    auth2.signIn()
    .then(function() { 
      console.log(auth2)
    })
    .catch(function(error){
      console.log(error)
    });
    attachSignin(document.getElementById('google-button'));
    });
};

我已经看到答案,我需要将'gaps.load'与'gap.auth2.init'分开,但是我发现init上存在错误,因为未定义。这段代码有效,我可以登录,但是我总是弹出“错误:popup_closed_by_user”

此外,我没有任何广告拦截器,并且我在所有设备和所有浏览器上都收到此错误。

0 个答案:

没有答案
相关问题