I dont care

This commit is contained in:
Evert Prants 2020-01-29 00:04:34 +02:00
parent 55b4bcda3f
commit 52ec490202
Signed by: evert
GPG Key ID: 1688DA83D222D0B5

View File

@ -30,19 +30,19 @@
var startApp = function() { var startApp = function() {
gapi.load('auth2', function(){ gapi.load('auth2', function(){
// Retrieve the singleton for the GoogleAuth library and set up the client. // Retrieve the singleton for the GoogleAuth library and set up the client.
auth2 = gapi.auth2.init({ var auth2 = gapi.auth2.init({
client_id: '#{auth.google}', client_id: '#{auth.google}',
cookie_policy: 'single_host_origin', cookie_policy: 'single_host_origin',
fetch_basic_profile: true fetch_basic_profile: true
}).then(function () { }).then(function () {
attachSignin(document.querySelector('.google-login')); attachSignin(auth2, document.querySelector('.google-login'));
}, function (e) { }, function (e) {
console.error(e); console.error(e);
}); });
}); });
}; };
function attachSignin(element) { function attachSignin(auth2, element) {
auth2.attachClickHandler(element, {}, auth2.attachClickHandler(element, {},
function (googleUser) { function (googleUser) {
let profile = googleUser.getBasicProfile(); let profile = googleUser.getBasicProfile();