为什么GoogleAuth.then()会停止调用回调?

sti*_*ure 6 google-identity-toolkit google-signin

我的应用程序依赖于Google登录.突然,今天,该GoogleAuth.then()方法已停止调用其回调.此代码不执行任何操作(不打印结果):

gapi.auth2.init({
    client_id: 'MYID.apps.googleusercontent.com',
    scope: 'profile email'
}).then(function() {
    console.log("success called");
}, function() {
    console.log("failure called")
});
Run Code Online (Sandbox Code Playgroud)

即使使用其他方法来查询signin(例如在isSignedIn和currentUser上创建侦听器)也能正常工作,此代码也不执行任何操作.

我们的代码没有改变,但这种破坏似乎在我们的客户群中慢慢滚动,感觉像谷歌做某种滚动部署一样模糊.目前这个问题已经有几个小时了.它已停止在我的笔记本电脑上工作,但仍然在我的手机上工作.我们在世界各地的许多客户都遇到了不同的结果.

这是Google的错误吗?如何向某人举报?

小智 3

我今天遇到了类似的问题,因为我需要快速破解

<div class="g-signin2" data-onsuccess="onSignIn">

不工作,我现在这样称呼它:

   <script src="https://apis.google.com/js/platform.js?onload=sss"
async defer></script>

function sss() {
    auth2 = gapi.auth2.getAuthInstance();
    auth2.isSignedIn.listen(
        function(isSigned){
            if (isSigned) onSignIn(window._auth2.currentUser.get());
            else signOut();
       })
    }
Run Code Online (Sandbox Code Playgroud)

有用。