Bug 1013064 (part 1) - prompt for master-password unlock when interacting with about:accounts. r=ttaubert
authorMark Hammond <mhammond@skippinet.com.au>
Wed, 11 Jun 2014 17:34:24 +1000
changeset 194185 e5dfe9801f76b1694bd83036cdf69856779a8f5a
parent 194184 68128a705799ce4c56f9e8c1d54377436f8ed3ff
child 194186 11f3a97d1d2c1a3ddbecd37cb7ed2d9a91d380bf
push id27139
push userkwierso@gmail.com
push dateTue, 15 Jul 2014 23:58:05 +0000
treeherdermozilla-central@95f2ad2787b3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersttaubert
bugs1013064
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1013064 (part 1) - prompt for master-password unlock when interacting with about:accounts. r=ttaubert From 18f9d132020afee6004e63c9006245e4d3b04e18 Mon Sep 17 00:00:00 2001 --- browser/base/content/aboutaccounts/aboutaccounts.js | 9 +++++++++ 1 file changed, 9 insertions(+)
browser/base/content/aboutaccounts/aboutaccounts.js
--- a/browser/base/content/aboutaccounts/aboutaccounts.js
+++ b/browser/base/content/aboutaccounts/aboutaccounts.js
@@ -7,16 +7,19 @@
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/FxAccounts.jsm");
 
 let fxAccountsCommon = {};
 Cu.import("resource://gre/modules/FxAccountsCommon.js", fxAccountsCommon);
 
+// for master-password utilities
+Cu.import("resource://services-sync/util.js");
+
 const PREF_LAST_FXA_USER = "identity.fxaccounts.lastSignedInUserHash";
 const PREF_SYNC_SHOW_CUSTOMIZATION = "services.sync.ui.showCustomizationDialog";
 
 const OBSERVER_TOPICS = [
   fxAccountsCommon.ONVERIFIED_NOTIFICATION,
   fxAccountsCommon.ONLOGOUT_NOTIFICATION,
 ];
 
@@ -99,16 +102,22 @@ let wrapper = {
                   .wrappedJSObject;
 
     // Don't show about:accounts with FxA disabled.
     if (!weave.fxAccountsEnabled) {
       document.body.remove();
       return;
     }
 
+    // If a master-password is enabled, we want to encourage the user to
+    // unlock it.  Things still work if not, but the user will probably need
+    // to re-auth next startup (in which case we will get here again and
+    // re-prompt)
+    Utils.ensureMPUnlocked();
+
     let iframe = document.getElementById("remote");
     this.iframe = iframe;
     iframe.addEventListener("load", this);
 
     try {
       iframe.src = url || fxAccounts.getAccountsSignUpURI();
     } catch (e) {
       error("Couldn't init Firefox Account wrapper: " + e.message);