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
parent e45cb1544d
commit 6b63924827
2 changed files with 5 additions and 1 deletions

View File

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

View File

@ -414,6 +414,8 @@ add_task(function* test_helpers_change_password() {
do_check_true(credentials.hasOwnProperty("email"));
do_check_true(credentials.hasOwnProperty("uid"));
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.
do_check_false(credentials.hasOwnProperty("foo"));
wasCalled.updateUserAccountData = true;