Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8" name="google-signin-client_id" content="503693956193-qaq9k02vibebr4la22ta1ggsutbmj5ts.apps.googleusercontent.com">
- <title>Title</title>
- <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
- <script src="https://apis.google.com/js/platform.js" async defer></script>
- </head>
- <body>
- <div class="g-signin2" data-onsuccess="onSignIn"></div>
- <a href="#" onclick="signOut()">Sign out</a>
- <script>
- function onSignIn(googleUser) {
- alert('fwef')
- var profile = googleUser.getBasicProfile();
- alert('ID: ' + profile.getId()); // Do not send to your backend! Use an ID token instead.
- alert('Name: ' + profile.getName());
- alert('Image URL: ' + profile.getImageUrl());
- alert('Email: ' + profile.getEmail()); // This is null if the 'email' scope is not present.
- }
- function signOut() {
- alert('1')
- var auth2 = gapi.auth2.getAuthInstance();
- alert(2)
- auth2.signOut().then(function () {
- alert('User signed out.');
- });
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement