I have the following snippet of code:
var myParams = {
'clientid' : 'XXXXX.apps.googleusercontent.com',
'cookiepolicy' : 'single_host_origin',
'callback' : _.bind(function(response){ this._loginGoogleCb(response); }, this),
'scope' : 'https://www.googleapis.com/auth/plus.me https://www.googleapis.com/auth/plus.profile.emails.read',
'requestvisibleactions' : 'http://schemas.google.com/AddActivity'
};
gapi.auth.signIn(myParams);
The first time I click the button and this code gets executed, there is no problem.
But when I click the button for a second time, the callback (and only the callback) gets executed twice.
Every time I execute this code, the number of requests to the Google server (and the related callback) increases by 1.
I double checked, the calling function itself gets only executed once when repeated.
The button click itself is not the problem.
Any idea what might be the problem?