From f8e5b1e2ff50b09b5e89fe70aa73e7c3ded89e91 Mon Sep 17 00:00:00 2001 From: benweet Date: Sat, 30 Aug 2014 14:25:00 +0100 Subject: [PATCH] Fixed google authorization popup. Fixes #495 --- public/res/helpers/googleHelper.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/public/res/helpers/googleHelper.js b/public/res/helpers/googleHelper.js index b3ddd472..d2acc04d 100644 --- a/public/res/helpers/googleHelper.js +++ b/public/res/helpers/googleHelper.js @@ -167,9 +167,15 @@ define([ gapi.auth.setToken(currentToken); if(!authResult || authResult.error) { if(connected === true && immediate === true) { - // If immediate did not work retry without immediate - // flag - immediate = false; + // If immediate did not work + if(authuser < 5 && authorizationMgr.getUserId()) { + // Try immediate with next authuser + authuser++; + } + else { + // retry without immediate flag + immediate = false; + } task.chain(oauthRedirect); } else { @@ -199,8 +205,7 @@ define([ function startAuthenticate() { immediate = true; if(authorizationMgr.token && authorizationMgr.isAuthorized(permission)) { - task.chain(); - return; + return task.chain(); } if(!authorizationMgr.getUserId()) { immediate = false;