WIP: add basic stuff

This commit is contained in:
AJ ONeal 2019-08-05 19:51:35 -06:00
vanhempi a33b0dbf6a
commit e1141c00f0
2 muutettua tiedostoa jossa 21 lisäystä ja 0 poistoa

16
public/app.js Normal file
Näytä tiedosto

@ -0,0 +1,16 @@
'use strict';
function onSignIn(googleUser) {
var profile = googleUser.getBasicProfile();
console.log('ID: ' + profile.getId()); // Do not send to your backend! Use an ID token instead.
console.log('Name: ' + profile.getName());
console.log('Image URL: ' + profile.getImageUrl());
console.log('Email: ' + profile.getEmail()); // This is null if the 'email' scope is not present.
}
function signOut() {
var auth2 = gapi.auth2.getAuthInstance();
auth2.signOut().then(function () {
console.log('User signed out.');
});
}

Näytä tiedosto

@ -83,3 +83,8 @@ You shouldn't use it for automated testing, because it will change, but it looks
}
</code></pre>
<script src="https://apis.google.com/js/platform.js" async defer></script>
<div class="g-signin2" data-onsuccess="onSignIn"></div>
<a href="#" onclick="signOut();">Sign out</a>
<script src="app.js"></script>