Fixed google authorization popup. Fixes #495

This commit is contained in:
benweet 2014-08-30 14:25:00 +01:00
parent 113f0edbfa
commit f8e5b1e2ff

View File

@ -167,9 +167,15 @@ define([
gapi.auth.setToken(currentToken); gapi.auth.setToken(currentToken);
if(!authResult || authResult.error) { if(!authResult || authResult.error) {
if(connected === true && immediate === true) { if(connected === true && immediate === true) {
// If immediate did not work retry without immediate // If immediate did not work
// flag if(authuser < 5 && authorizationMgr.getUserId()) {
immediate = false; // Try immediate with next authuser
authuser++;
}
else {
// retry without immediate flag
immediate = false;
}
task.chain(oauthRedirect); task.chain(oauthRedirect);
} }
else { else {
@ -199,8 +205,7 @@ define([
function startAuthenticate() { function startAuthenticate() {
immediate = true; immediate = true;
if(authorizationMgr.token && authorizationMgr.isAuthorized(permission)) { if(authorizationMgr.token && authorizationMgr.isAuthorized(permission)) {
task.chain(); return task.chain();
return;
} }
if(!authorizationMgr.getUserId()) { if(!authorizationMgr.getUserId()) {
immediate = false; immediate = false;