Bug 1300297 - Ensure FxA device id is cleared on password change. r=markh

--HG--
extra : rebase_source : 8dd0d1110340525407accf0a6173e09275c90a67
This commit is contained in:
Phil Booth 2016-09-03 06:17:00 +02:00
Родитель e45cb1544d
Коммит 6b63924827
2 изменённых файлов: 5 добавлений и 1 удалений

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

@ -333,7 +333,9 @@ this.FxAccountsWebChannelHelpers.prototype = {
// features (ie, new fields) - forcing the server to track a map of // features (ie, new fields) - forcing the server to track a map of
// versions to supported field names doesn't buy us much. // versions to supported field names doesn't buy us much.
// So we just remove field names we know aren't handled. // So we just remove field names we know aren't handled.
let newCredentials = {}; let newCredentials = {
deviceId: null
};
for (let name of Object.keys(credentials)) { for (let name of Object.keys(credentials)) {
if (name == "email" || name == "uid" || FxAccountsStorageManagerCanStoreField(name)) { if (name == "email" || name == "uid" || FxAccountsStorageManagerCanStoreField(name)) {
newCredentials[name] = credentials[name]; newCredentials[name] = credentials[name];

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

@ -414,6 +414,8 @@ add_task(function* test_helpers_change_password() {
do_check_true(credentials.hasOwnProperty("email")); do_check_true(credentials.hasOwnProperty("email"));
do_check_true(credentials.hasOwnProperty("uid")); do_check_true(credentials.hasOwnProperty("uid"));
do_check_true(credentials.hasOwnProperty("kA")); do_check_true(credentials.hasOwnProperty("kA"));
do_check_true(credentials.hasOwnProperty("deviceId"));
do_check_null(credentials.deviceId);
// "foo" isn't a field known by storage, so should be dropped. // "foo" isn't a field known by storage, so should be dropped.
do_check_false(credentials.hasOwnProperty("foo")); do_check_false(credentials.hasOwnProperty("foo"));
wasCalled.updateUserAccountData = true; wasCalled.updateUserAccountData = true;