Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No call from gapi.auth.authorize #11

Closed
wonderfly opened this issue Jan 7, 2015 · 2 comments
Closed

No call from gapi.auth.authorize #11

wonderfly opened this issue Jan 7, 2015 · 2 comments

Comments

@wonderfly
Copy link
Contributor

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

@wonderfly
Copy link
Contributor Author

From obr...@google.com on May 07, 2012 11:18:50

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.

window.setTimeout(checkAuth,1);

Status: Done
Owner: obr...@google.com

@wonderfly
Copy link
Contributor Author

From dmat...@componence.in on October 18, 2012 00:02:57

I am working with newly updated version of the code given on authentication page
but i am also facing the same issue.

is using checkAuth() mandatory,

@wonderfly wonderfly removed their assignment Jan 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant