- Timestamp:
- 2021-09-04T16:25:30+12:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/web/interfaces/default/transform/layouts/header.xsl
r35322 r35331 97 97 function gslogout(logout_action_url) { 98 98 if (googlesignin_client_id != '') { 99 google Signout();99 googleLogout(); 100 100 } 101 101 window.location = logout_action_url; … … 187 187 function googleSigninInit() { 188 188 gapi.load('auth2', function() { 189 auth2 = gapi.auth2.init({189 var auth2 = gapi.auth2.init({ 190 190 client_id: googlesignin_client_id, 191 191 //scope: 'email' // don't need to top up 'profile' with 'email' as not used client side (email is retrieved via GS3 Servlet) 192 }); 192 }) 193 .then(function() { 194 if (typeof optGoogleAuth2InitCallback === "function"){ 195 optGoogleAuth2InitCallback(); 196 } 197 }); 193 198 }); 194 199 } 195 200 196 function google Signout() {201 function googleLogout() { 197 202 var auth2 = gapi.auth2.getAuthInstance(); 198 auth2.signOut().then(function () { 203 // Use 'disconnect()' rather than 'signOut()' as this does a deeper logout 204 // that revokes the user's "Google granted" permission. 205 // This makes it easier, when using the same browser, to login into Greenstone3 206 // using a differeng Google sign-in account 207 208 auth2.disconnect().then(function () { 199 209 console.log("Google-authenticated User signed out"); 200 210 });
Note:
See TracChangeset
for help on using the changeset viewer.