feat(session): Pass `options.type` to recoveryEmailResendCode (#266), r=@philbooth

This commit is contained in:
Vijay Budhram 2017-10-26 09:47:30 -04:00 коммит произвёл GitHub
Родитель 5ff439433c
Коммит 8984e25dec
2 изменённых файлов: 10 добавлений и 2 удалений

Просмотреть файл

@ -363,6 +363,9 @@ define([
* Opaque url-encoded string that will be included in the verification link * Opaque url-encoded string that will be included in the verification link
* as a querystring parameter, useful for continuing an OAuth flow for * as a querystring parameter, useful for continuing an OAuth flow for
* example. * example.
* @param {String} [options.type]
* Specifies the type of code to send, currently only supported type is
* `upgradeSession`.
* @param {String} [options.lang] * @param {String} [options.lang]
* set the language for the 'Accept-Language' header * set the language for the 'Accept-Language' header
* @return {Promise} A promise that will be fulfilled with JSON `xhr.responseText` of the request * @return {Promise} A promise that will be fulfilled with JSON `xhr.responseText` of the request
@ -393,6 +396,10 @@ define([
data.resume = options.resume; data.resume = options.resume;
} }
if (options.type) {
data.type = options.type;
}
if (options.lang) { if (options.lang) {
requestOpts.headers = { requestOpts.headers = {
'Accept-Language': options.lang 'Accept-Language': options.lang

Просмотреть файл

@ -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 user;
var opts = { var opts = {
service: 'sync', service: 'sync',
redirectTo: 'https://sync.firefox.com/after_reset', redirectTo: 'https://sync.firefox.com/after_reset',
resume: 'resumejwt' resume: 'resumejwt',
type: 'upgradeSession'
}; };
return accountHelper.newUnverifiedAccount() return accountHelper.newUnverifiedAccount()