logout.html 953 B

1234567891011121314151617181920212223242526272829303132
  1. <!DOCTYPE html>
  2. <html lang="">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width,initial-scale=1.0">
  7. <meta name="google-signin-client_id" content="398214166622-jkme0i3k4tbsgqh19aejaqatrark5l94.apps.googleusercontent.com">
  8. <title>Clear google Login</title>
  9. </head>
  10. <body>
  11. <h1>Clear Google Token</h1>
  12. <button onclick="Logout()">Logout</button>
  13. <script>
  14. function Logout() {
  15.         console.log('onSuccess');
  16.       var auth2 = gapi.auth2.getAuthInstance();
  17.       auth2.signOut().then(function () {
  18. window.location.href = '/'
  19.       });
  20.     }
  21. function onLoad() {
  22. gapi.load('auth2', function() {
  23. gapi.auth2.init();
  24. });
  25. }
  26. </script>
  27. <script src="https://apis.google.com/js/platform.js?onload=onLoad" async defer></script>
  28. </body>
  29. </html>