summaryrefslogtreecommitdiffstats
path: root/services/sync/modules/identity.js
diff options
context:
space:
mode:
Diffstat (limited to 'services/sync/modules/identity.js')
-rw-r--r--services/sync/modules/identity.js29
1 files changed, 14 insertions, 15 deletions
diff --git a/services/sync/modules/identity.js b/services/sync/modules/identity.js
index b4da8c0bb..f89ffca47 100644
--- a/services/sync/modules/identity.js
+++ b/services/sync/modules/identity.js
@@ -13,7 +13,6 @@ Cu.import("resource://gre/modules/Promise.jsm");
Cu.import("resource://services-sync/constants.js");
Cu.import("resource://gre/modules/Log.jsm");
Cu.import("resource://services-sync/util.js");
-Cu.import("resource://services-common/async.js");
// Lazy import to prevent unnecessary load on startup.
for (let symbol of ["BulkKeyBundle", "SyncKeyBundle"]) {
@@ -85,14 +84,18 @@ IdentityManager.prototype = {
_syncKeyBundle: null,
/**
- * Initialize the identity provider.
+ * Initialize the identity provider. Returns a promise that is resolved
+ * when initialization is complete and the provider can be queried for
+ * its state
*/
initialize: function() {
// Nothing to do for this identity provider.
+ return Promise.resolve();
},
finalize: function() {
// Nothing to do for this identity provider.
+ return Promise.resolve();
},
/**
@@ -111,6 +114,14 @@ IdentityManager.prototype = {
return Promise.resolve();
},
+ /**
+ * Indicates if the identity manager is still initializing
+ */
+ get readyToAuthenticate() {
+ // We initialize in a fully sync manner, so we are always finished.
+ return true;
+ },
+
get account() {
return Svc.Prefs.get("account", this.username);
},
@@ -326,7 +337,7 @@ IdentityManager.prototype = {
try {
this._syncKeyBundle = new SyncKeyBundle(this.username, this.syncKey);
} catch (ex) {
- this._log.warn("Failed to create sync bundle", ex);
+ this._log.warn("Failed to create sync key bundle", ex);
return null;
}
}
@@ -447,9 +458,6 @@ IdentityManager.prototype = {
try {
service.recordManager.get(service.storageURL + "meta/fxa_credentials");
} catch (ex) {
- if (Async.isShutdownException(ex)) {
- throw ex;
- }
this._log.warn("Failed to pre-fetch the migration sentinel", ex);
}
},
@@ -593,13 +601,4 @@ IdentityManager.prototype = {
// Do nothing for Sync 1.1.
return {accepted: true};
},
-
- // Tell Sync what the login status should be if it saw a 401 fetching
- // info/collections as part of login verification (typically immediately
- // after login.)
- // In our case it means an authoritative "password is incorrect".
- loginStatusFromVerification404() {
- return LOGIN_FAILED_LOGIN_REJECTED;
- }
-
};