Bug 1357085 - Don't automatically redirect to Sync prefs after confirming an FxA sign-in or sign-up. r=markh draft
authorKit Cambridge <kit@yakshaving.ninja>
Tue, 05 Sep 2017 11:37:36 -0700
changeset 673832 3419469c436511888864063e490b8ed2c83aa9a0
parent 673759 15f221f491f707b1e8e46da344b6dd5a394b1242
child 734165 16fdda79f92e9d50cb444b30d369638742169bd7
push id82660
push userbmo:kit@mozilla.com
push dateMon, 02 Oct 2017 22:04:41 +0000
reviewersmarkh
bugs1357085
milestone58.0a1
Bug 1357085 - Don't automatically redirect to Sync prefs after confirming an FxA sign-in or sign-up. r=markh MozReview-Commit-ID: 6fwHcgqmFKJ
browser/base/content/aboutaccounts/aboutaccounts.js
--- a/browser/base/content/aboutaccounts/aboutaccounts.js
+++ b/browser/base/content/aboutaccounts/aboutaccounts.js
@@ -13,21 +13,16 @@ Cu.import("resource://gre/modules/FxAcco
 var fxAccountsCommon = {};
 Cu.import("resource://gre/modules/FxAccountsCommon.js", fxAccountsCommon);
 
 // for master-password utilities
 Cu.import("resource://services-sync/util.js");
 
 const ACTION_URL_PARAM = "action";
 
-const OBSERVER_TOPICS = [
-  fxAccountsCommon.ONVERIFIED_NOTIFICATION,
-  fxAccountsCommon.ONLOGOUT_NOTIFICATION,
-];
-
 function log(msg) {
   // dump("FXA: " + msg + "\n");
 }
 
 function updateDisplayedEmail(user) {
   let emailDiv = document.getElementById("email");
   if (emailDiv && user) {
     emailDiv.textContent = user.email;
@@ -295,29 +290,20 @@ document.addEventListener("DOMContentLoa
 
   var buttonOpenPrefs = document.getElementById("buttonOpenPrefs");
   buttonOpenPrefs.addEventListener("click", openPrefs);
 }, {capture: true, once: true});
 
 function initObservers() {
   function observe(subject, topic, data) {
     log("about:accounts observed " + topic);
-    if (topic == fxAccountsCommon.ONLOGOUT_NOTIFICATION) {
-      // All about:account windows get changed to action=signin on logout.
-      window.location = "about:accounts?action=signin";
-      return;
-    }
-
-    // must be onverified - we want to open preferences.
-    openPrefs();
+    window.location = "about:accounts?action=signin";
   }
 
-  for (let topic of OBSERVER_TOPICS) {
-    Services.obs.addObserver(observe, topic);
-  }
+  Services.obs.addObserver(observe, fxAccountsCommon.ONLOGOUT_NOTIFICATION);
+
   window.addEventListener("unload", function(event) {
-    log("about:accounts unloading")
-    for (let topic of OBSERVER_TOPICS) {
-      Services.obs.removeObserver(observe, topic);
-    }
+    log("about:accounts unloading");
+    Services.obs.removeObserver(observe,
+                                fxAccountsCommon.ONLOGOUT_NOTIFICATION);
   });
 }
 initObservers();