[Pkg-mozext-commits] [gcontactsync] 43/88: Issue #23 - 'Please login before trying to sync contacts' message when canceling the expired token prompt.

David Prévot taffit at moszumanska.debian.org
Thu Sep 18 20:52:28 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository gcontactsync.

commit 18478cbc17ae193ee1b2be56901ac06659edeb1a
Author: Josh Geenen <joshgeenen at gmail.com>
Date:   Thu Feb 27 21:21:29 2014 -0600

    Issue #23 - 'Please login before trying to sync contacts' message when canceling the expired token prompt.
---
 src/content/GHttpRequest.js | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/content/GHttpRequest.js b/src/content/GHttpRequest.js
index 3d5603f..a9aaea5 100644
--- a/src/content/GHttpRequest.js
+++ b/src/content/GHttpRequest.js
@@ -177,11 +177,6 @@ com.gContactSync.handle401 = function gCS_handle401(httpRequest) {
   if (com.gContactSync.Preferences.mSyncPrefs.synchronizing.value) {
     // Get the current username
     var username = com.gContactSync.Sync.mCurrentUsername;
-    // Remove the auth token if it wasn't already
-    if (com.gContactSync.LoginManager.mAuthTokens[username]) {
-      com.gContactSync.LOGGER.VERBOSE_LOG(" * Removing old auth token");
-      com.gContactSync.LoginManager.removeAuthToken(username);
-    }
     com.gContactSync.alertWarning(com.gContactSync.StringBundle.getStr("tokenExpiredMsg"));
     // Prompt for the username and password
     var prompt   = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
@@ -246,6 +241,11 @@ com.gContactSync.finish401 = function gCS_finish401(aUsername, aAuthToken) {
   com.gContactSync.LOGGER.VERBOSE_LOG(" * finish401 called: " + aUsername +
                                       " - " + aAuthToken);
   if (aUsername && aAuthToken) {
+    // Remove the auth token if it wasn't already
+    if (com.gContactSync.LoginManager.mAuthTokens[aUsername]) {
+      com.gContactSync.LOGGER.VERBOSE_LOG(" * Removing old auth token");
+      com.gContactSync.LoginManager.removeAuthToken(aUsername);
+    }
     var token = 'GoogleLogin ' + aAuthToken;
     com.gContactSync.LoginManager.addAuthToken(aUsername, token);
     com.gContactSync.Sync.mCurrentAuthToken = token;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/gcontactsync.git



More information about the Pkg-mozext-commits mailing list