Проблема с выходом из Google. - PullRequest
0 голосов
/ 12 февраля 2020

Использование файла php для выхода из системы при уничтожении php SESSION и последующей обработки выхода из системы Google в HTML.

ReferenceError: gapi не определено

Код:

    <!-- jquery js --> 
    <script type="text/javascript" src="/js/jquery.min.js"></script> 
    <!-- Google async lib-->
    <script src="https://apis.google.com/js/platform.js" async defer></script>
    <meta name="google-signin-client_id" content="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com">
</head>
<body>
<script>
$(function() {
    init();
    signOut();
});

function init() {
    gapi.load('auth2', function() {
    /* Ready. Make a call to gapi.auth2.init or some other API */
    });
}

function signOut() {
    var auth2 = gapi.auth2.getAuthInstance();
    auth2.signOut().then(function () {
      console.log('User signed out.');
      window.location.href = "https://partyplanner.mx/login";
    });
}

</script>
</body>
...