diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
commit | da4c7e7ed675c3bf405668739c3012d140856109 (patch) | |
tree | cdd868dba063fecba609a1d819de271f0d51b23e /services/fxaccounts/FxAccountsWebChannel.sys.mjs | |
parent | Adding upstream version 125.0.3. (diff) | |
download | firefox-da4c7e7ed675c3bf405668739c3012d140856109.tar.xz firefox-da4c7e7ed675c3bf405668739c3012d140856109.zip |
Adding upstream version 126.0.upstream/126.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'services/fxaccounts/FxAccountsWebChannel.sys.mjs')
-rw-r--r-- | services/fxaccounts/FxAccountsWebChannel.sys.mjs | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/services/fxaccounts/FxAccountsWebChannel.sys.mjs b/services/fxaccounts/FxAccountsWebChannel.sys.mjs index f8d7a3362d..14ba222a9e 100644 --- a/services/fxaccounts/FxAccountsWebChannel.sys.mjs +++ b/services/fxaccounts/FxAccountsWebChannel.sys.mjs @@ -80,6 +80,13 @@ XPCOMUtils.defineLazyPreferenceGetter( val => Services.io.newURI(val) ); +XPCOMUtils.defineLazyPreferenceGetter( + lazy, + "oauthEnabled", + "identity.fxaccounts.oauth.enabled", + false +); + // These engines were added years after Sync had been introduced, they need // special handling since they are system add-ons and are un-available on // older versions of Firefox. @@ -487,16 +494,19 @@ FxAccountsWebChannelHelpers.prototype = { "webchannel" ); - const xps = await this._initializeSync(); - await this._fxAccounts._internal.setSignedInUser(accountData); - - if (requestedServices) { - // User has enabled Sync. - if (requestedServices.sync) { - const { offeredEngines, declinedEngines } = requestedServices.sync; - this._setEnabledEngines(offeredEngines, declinedEngines); - log.debug("Webchannel is enabling sync"); - await xps.Weave.Service.configure(); + if (lazy.oauthEnabled) { + await this._fxAccounts._internal.setSignedInUser(accountData); + } else { + const xps = await this._initializeSync(); + await this._fxAccounts._internal.setSignedInUser(accountData); + if (requestedServices) { + // User has enabled Sync. + if (requestedServices.sync) { + const { offeredEngines, declinedEngines } = requestedServices.sync; + this._setEnabledEngines(offeredEngines, declinedEngines); + log.debug("Webchannel is enabling sync"); + await xps.Weave.Service.configure(); + } } } }, @@ -628,9 +638,7 @@ FxAccountsWebChannelHelpers.prototype = { }; }, _getCapabilities() { - if ( - Services.prefs.getBoolPref("identity.fxaccounts.oauth.enabled", false) - ) { + if (lazy.oauthEnabled) { return { multiService: true, pairing: lazy.pairingEnabled, |