Advertisement
Guest User

Untitled

a guest
Feb 19th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function checkAuth() {
  2.     gapi.auth.authorize({
  3.         'client_id': CLIENT_ID,
  4.         'scope': SCOPES.join(' '),
  5.         'immediate': true
  6.     }, handleAuthResult);
  7. }
  8.  
  9. //authorize apps
  10. function handleAuthClick(event) {
  11.     gapi.auth.authorize(
  12.           { client_id: CLIENT_ID, scope: SCOPES, immediate: false },
  13.           handleAuthResult);
  14.     return false;
  15. }
  16.  
  17. //check the return authentication of the login is successful, we display the drive box and hide the login box.
  18. function handleAuthResult(authResult) {
  19.     if (authResult && !authResult.error) {
  20.         $("#drive-box").show();
  21.         $("#drive-box").css("display","inline-block");
  22.         $("#login-box").hide();
  23.         showLoading();
  24.         getDriveFiles();
  25.     } else {
  26.         $("#login-box").show();
  27.         $("#drive-box").hide();
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement