Bug 1556276 p1 - Allow extraParams to be passed when constructing FxA URLs. r=markh
authorEdouard Oger <eoger@fastmail.com>
Wed, 24 Jul 2019 18:34:06 +0000
changeset 484653 0f861296caf449d69b533e5946f6566311ba130a
parent 484652 edcdfaa8a2b1a47e0c1364cecf7fa81df6646d2d
child 484654 98bedd1bb061e2ec8a858b11227f1f27e599d39c
push id36341
push useraciure@mozilla.com
push dateThu, 25 Jul 2019 09:55:18 +0000
treeherdermozilla-central@5805cd9ae294 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarkh
bugs1556276
milestone70.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 1556276 p1 - Allow extraParams to be passed when constructing FxA URLs. r=markh Differential Revision: https://phabricator.services.mozilla.com/D39032
services/fxaccounts/FxAccountsConfig.jsm
--- a/services/fxaccounts/FxAccountsConfig.jsm
+++ b/services/fxaccounts/FxAccountsConfig.jsm
@@ -52,83 +52,85 @@ const CONFIG_PREFS = [
   "identity.fxaccounts.auth.uri",
   "identity.fxaccounts.remote.oauth.uri",
   "identity.fxaccounts.remote.profile.uri",
   "identity.fxaccounts.remote.pairing.uri",
   "identity.sync.tokenserver.uri",
 ];
 
 var FxAccountsConfig = {
-  async promiseSignUpURI(entrypoint) {
+  async promiseSignUpURI(entrypoint, extraParams = {}) {
     return this._buildURL("signup", {
-      extraParams: { entrypoint },
+      extraParams: { entrypoint, ...extraParams },
     });
   },
 
-  async promiseSignInURI(entrypoint) {
+  async promiseSignInURI(entrypoint, extraParams = {}) {
     return this._buildURL("signin", {
-      extraParams: { entrypoint },
+      extraParams: { entrypoint, ...extraParams },
     });
   },
 
-  async promiseEmailURI(email, entrypoint) {
+  async promiseEmailURI(email, entrypoint, extraParams = {}) {
     return this._buildURL("", {
-      extraParams: { entrypoint, email },
+      extraParams: { entrypoint, email, ...extraParams },
     });
   },
 
-  async promiseEmailFirstURI(entrypoint) {
+  async promiseEmailFirstURI(entrypoint, extraParams = {}) {
     return this._buildURL("", {
-      extraParams: { entrypoint, action: "email" },
+      extraParams: { entrypoint, action: "email", ...extraParams },
     });
   },
 
-  async promiseForceSigninURI(entrypoint) {
+  async promiseForceSigninURI(entrypoint, extraParams = {}) {
     return this._buildURL("force_auth", {
-      extraParams: { entrypoint },
+      extraParams: { entrypoint, ...extraParams },
       addAccountIdentifiers: true,
     });
   },
 
-  async promiseManageURI(entrypoint) {
+  async promiseManageURI(entrypoint, extraParams = {}) {
     return this._buildURL("settings", {
-      extraParams: { entrypoint },
+      extraParams: { entrypoint, ...extraParams },
       addAccountIdentifiers: true,
     });
   },
 
-  async promiseChangeAvatarURI(entrypoint) {
+  async promiseChangeAvatarURI(entrypoint, extraParams = {}) {
     return this._buildURL("settings/avatar/change", {
-      extraParams: { entrypoint },
+      extraParams: { entrypoint, ...extraParams },
       addAccountIdentifiers: true,
     });
   },
 
-  async promiseManageDevicesURI(entrypoint) {
+  async promiseManageDevicesURI(entrypoint, extraParams = {}) {
     return this._buildURL("settings/clients", {
-      extraParams: { entrypoint },
+      extraParams: { entrypoint, ...extraParams },
       addAccountIdentifiers: true,
     });
   },
 
-  async promiseConnectDeviceURI(entrypoint) {
+  async promiseConnectDeviceURI(entrypoint, extraParams = {}) {
     return this._buildURL("connect_another_device", {
-      extraParams: { entrypoint },
+      extraParams: { entrypoint, ...extraParams },
       addAccountIdentifiers: true,
     });
   },
 
-  async promisePairingURI() {
+  async promisePairingURI(extraParams = {}) {
     return this._buildURL("pair", {
+      extraParams,
       includeDefaultParams: false,
     });
   },
 
-  async promiseOAuthURI() {
+  async promiseOAuthURI(extraParams = {}) {
     return this._buildURL("oauth", {
+      extraParams,
       includeDefaultParams: false,
     });
   },
 
   get defaultParams() {
     return { service: "sync", context: CONTEXT_PARAM };
   },