X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=root%2Fsrc%2Fauth%2Flogin.tt;h=1d1a6c2fc2aab5056f28489372bafb7240371b65;hb=c2ab34976078af676adcf006768f6ebf350d2cfb;hp=61575b1103ecb2e92a609703ac68f4eb0d07aee7;hpb=eb38afbcd0ef1e20b95b9954a0b8d0f107d0c342;p=scpubgit%2Fstemmaweb.git diff --git a/root/src/auth/login.tt b/root/src/auth/login.tt index 61575b1..1d1a6c2 100644 --- a/root/src/auth/login.tt +++ b/root/src/auth/login.tt @@ -18,7 +18,38 @@ $(document).ready(function() { }, 2000 ); } }); + + function googleSignIn(authResult) { + if (authResult['status']['signed_in']) { + document.getElementById('signinButton').setAttribute('style', 'display:none'); + gapi.client.load('plus', 'v1', function apiClientLoaded() { + gapi.client.plus.people.get({ userId: 'me'}).execute(function infoRetrieved(resp) { + var primaryEmail; + for (var i = 0; i < resp.emails.length; i++) { + if (resp.emails[i].type === 'account') { + primaryEmail = resp.emails[i].value; + } + } + + dataRetrieved(authResult, primaryEmail); + }); + }); + } else { + console.log("Error", authResult); + } + } + + function dataRetrieved(login, email) { + console.log(email); + console.log(login.id_token); + + document.getElementById('email').value = email; + document.getElementById('id_token').value = login.id_token; + document.getElementById('google_form').submit(); + } + + [% END %]

Stemmaweb - Sign in

@@ -47,20 +78,31 @@ $(document).ready(function() {

Sign in with Google

If you have a Google account, you may use it to sign into Stemmaweb.

-
- - - + + + + + +

Sign in with OpenID

If you have an account with an OpenID provider (e.g. WordPress, Blogger, Flickr, Yahoo), you may use it to sign into Stemmaweb. -

+ - - + +
@@ -84,4 +126,4 @@ $(document).ready(function() { [% END %]
[% END %] -[% PROCESS footer.tt %] \ No newline at end of file +[% PROCESS footer.tt %]