title: Google+ Sign-In with JavaScript callback issue
body: <p>I am working on a function which allows users to sign in on my website with their Google account.</p>
  
  <p>My code is based on the <a href="https://developers.google.com/+/web/signin/javascript-flow">Google documentation</a> (others signIn() options are in meta tags).</p>
  
  <pre><code>function login() {
    gapi.auth.signIn({'callback':
      function (authResult) {
        if (authResult['status']['signed_in']) {
          console.log('Okay');
        }else {
          console.log('Error');
        }
      }
    });
  }
  </code></pre>
  
  <p>When I call login(), a Google pop up appears, I approve the terms of my application and everything works fine.</p>
  
  <p>But the callback is called twice :</p>
  
  <ul>
  <li>1st case: If I never approved apps permissions then the callback will be call at the opening of the pop up AND when I will approve the permissions. So it will write "Error" and "Okay".</li>
  <li>2nd case: If I already approved the permissions, it will write "Okay" two times.</li>
  </ul>
  
  <p>I added the option <code>'approvalprompt': 'force'</code> to the signIn() function. The callback function is no longer called twice but it forces the user to approve the app's permissions, even if previously approved. So it's not user friendly.</p>
  
  <p>Is there a friendly user way to approve the app's permissions one time without having two callback ?</p>
  
  <p>Thank you. </p>