Javascript Google Auth在2年后停止工作

Javascript Google Auth在2年后停止工作,javascript,google-api,google-calendar-api,Javascript,Google Api,Google Calendar Api,我得到了以下代码片段: // Google functions var clientId = 'clientid'; var apiKey = 'apikey'; var scopes = 'https://www.googleapis.com/auth/calendar'; function handleClientLoad() { // Step 2: Reference the API key gapi.client.setApiKey(apiKey); gapi

我得到了以下代码片段:

// Google functions
var clientId = 'clientid';
var apiKey = 'apikey';
var scopes = 'https://www.googleapis.com/auth/calendar';

function handleClientLoad() {
    // Step 2: Reference the API key
    gapi.client.setApiKey(apiKey);
    gapi.client.load('calendar', 'v3', function () {
        window.setTimeout(checkAuth, 1);
    });
}

function checkAuth() {
    gapi.auth.authorize({client_id: clientId, scope: scopes, immediate: true}, handleAuthResult);
}

function handleAuthResult(authResult) {
    console.error(authResult.error);
    if (authResult && !authResult.error) {
        if (!$('#authWait').is(':visible')) {
            $('#start').on("click", function () {
                $('#main').hide();
                $('#wizard').removeClass("hidden");
            });
        } else {
            $('#authWait').addClass("hidden");
            $('#wizard').removeClass("hidden");
        }
        fillCalendarList();
        ga('send', 'event', 'weergaveResultaat', 'action');
    } else {
        $('#start').on("click", function () {
            $('#main').hide();
            $('#authWait').removeClass("hidden");
            handleAuthClick();
        })
    }
}
我已经替换了clientid和apikey。上面的代码片段已经在完全相同的配置中工作了2年。但是,从昨天开始,我在
handleAuthResult
之后立即返回“立即失败”

我找不到谷歌自昨天以来所做更改的任何细节。我尝试过将立即转换为false,但这并没有解决任何问题

在立即失败后,我得到“Uncaught TypeError:无法设置未定义的属性”apiVersion“

有人知道这是什么原因吗