You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The authentication documentation has been updated. Notably, the checkAuth call should be called in a setTimeout, and there is no need to call gapi.auth.init if you use this authentication pattern.
From uci.ga.p...@gmail.com on February 04, 2012 17:28:29
gapi.auth.authorize within checkAuth() does not direct to handleAuthResult
(this is taken from google code found in the authentication tab)
function handleClientLoad() {
gapi.client.setApiKey(apiKey);
gapi.auth.init(checkAuth);
}
function checkAuth() {
alert("hi");
gapi.auth.authorize({client_id: clientId, scope: scopes, immediate: false}, handleAuthResult);
}
function handleAuthResult(authResult) {
alert(authResult);
var authorizeButton = document.getElementById('authorizeAccountButton');
if (authResult) {
authorizeButton.style.visibility = 'hidden';
makeApiCall();
} else {
authorizeButton.style.visibility = '';
authorizeButton.onclick = handleAuthClick;
}
}
function handleAuthClick(event) {
gapi.auth.authorize({client_id: clientId, scope: scopes, immediate: false}, handleAuthResult);
return false;
}
Original issue: http://code.google.com/p/google-api-javascript-client/issues/detail?id=9
The text was updated successfully, but these errors were encountered: