Bug 1370736 - reset the sync login status after an FxA login event. r?eoger draft
authorMark Hammond <mhammond@skippinet.com.au>
Wed, 07 Jun 2017 16:41:18 +1000
changeset 590112 bc831122d788656a2b3287ff6e1340d72e6fdd52
parent 589297 3cfe81678881ada0245215c8863bc9722925bb44
child 590147 476be9e757155a000e69c60f62b27174cf210b91
push id62597
push userbmo:markh@mozilla.com
push dateWed, 07 Jun 2017 06:43:35 +0000
reviewerseoger
bugs1370736
milestone55.0a1
Bug 1370736 - reset the sync login status after an FxA login event. r?eoger MozReview-Commit-ID: 6BLj6q8z79i
services/sync/modules/browserid_identity.js
--- a/services/sync/modules/browserid_identity.js
+++ b/services/sync/modules/browserid_identity.js
@@ -250,16 +250,21 @@ this.BrowserIDManager.prototype = {
     // new one.
     this._token = null;
   },
 
   observe(subject, topic, data) {
     this._log.debug("observed " + topic);
     switch (topic) {
     case fxAccountsCommon.ONLOGIN_NOTIFICATION: {
+      // If our existing Sync state is that we needed to reauth, clear that
+      // state now - it will get reset back if a problem persists.
+      if (Weave.Status.login == LOGIN_FAILED_LOGIN_REJECTED) {
+        Weave.Status.login = LOGIN_SUCCEEDED;
+      }
       // This should only happen if we've been initialized without a current
       // user - otherwise we'd have seen the LOGOUT notification and been
       // thrown away.
       // The exception is when we've initialized with a user that needs to
       // reauth with the server - in that case we will also get here, but
       // should have the same identity, and so we pass `false` into
       // initializeWithCurrentIdentity so that we won't do a full sync for our
       // first sync if we can avoid it.