Bug 1370736 - reset the sync login status after an FxA login event. r?eoger
MozReview-Commit-ID: 6BLj6q8z79i
--- 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.