1
0
Derivar 0

WIP: add basic stuff

Este cometimento está contido em:
AJ ONeal 2019-08-05 19:51:35 -06:00 cometido por AJ ONeal
ascendente 336941f584
cometimento 86e605f265
2 ficheiros modificados com 21 adições e 0 eliminações

16
public/app.js Ficheiro normal
Ver ficheiro

@ -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.');
});
}

Ver ficheiro

@ -105,3 +105,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>