From 8984e25dec31a26fc238c90bbe57011301d62e07 Mon Sep 17 00:00:00 2001 From: Vijay Budhram Date: Thu, 26 Oct 2017 09:47:30 -0400 Subject: [PATCH] feat(session): Pass `options.type` to recoveryEmailResendCode (#266), r=@philbooth --- client/FxAccountClient.js | 7 +++++++ tests/lib/recoveryEmail.js | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/client/FxAccountClient.js b/client/FxAccountClient.js index bfcb777..f984f6c 100644 --- a/client/FxAccountClient.js +++ b/client/FxAccountClient.js @@ -363,6 +363,9 @@ define([ * Opaque url-encoded string that will be included in the verification link * as a querystring parameter, useful for continuing an OAuth flow for * example. + * @param {String} [options.type] + * Specifies the type of code to send, currently only supported type is + * `upgradeSession`. * @param {String} [options.lang] * set the language for the 'Accept-Language' header * @return {Promise} A promise that will be fulfilled with JSON `xhr.responseText` of the request @@ -393,6 +396,10 @@ define([ data.resume = options.resume; } + if (options.type) { + data.type = options.type; + } + if (options.lang) { requestOpts.headers = { 'Accept-Language': options.lang diff --git a/tests/lib/recoveryEmail.js b/tests/lib/recoveryEmail.js index 7e95886..5723603 100644 --- a/tests/lib/recoveryEmail.js +++ b/tests/lib/recoveryEmail.js @@ -50,12 +50,13 @@ define([ ); }); - test('#recoveryEmailResendCode with service, redirectTo, and resume', function () { + test('#recoveryEmailResendCode with service, redirectTo, type, and resume', function () { var user; var opts = { service: 'sync', redirectTo: 'https://sync.firefox.com/after_reset', - resume: 'resumejwt' + resume: 'resumejwt', + type: 'upgradeSession' }; return accountHelper.newUnverifiedAccount()