Bug 1243729 - (m-b) Create another LoginInfo object when username is picked, r=MattN, a=lizzard

MozReview-Commit-ID: IRGUTFXiN9S
This commit is contained in:
Timothy Guan-tin Chien 2016-04-20 08:41:09 +08:00
parent 764078a82f
commit cacbaf2742

View File

@ -1351,7 +1351,13 @@ LoginManagerPrompter.prototype = {
// Now that we know which login to use, modify its password.
var selectedLogin = logins[selectedIndex.value];
this.log("Updating password for user " + selectedLogin.username);
this._updateLogin(selectedLogin, aNewLogin);
var newLoginWithUsername = Cc["@mozilla.org/login-manager/loginInfo;1"].
createInstance(Ci.nsILoginInfo);
newLoginWithUsername.init(aNewLogin.hostname,
aNewLogin.formSubmitURL, aNewLogin.httpRealm,
selectedLogin.username, aNewLogin.password,
selectedLogin.userNameField, aNewLogin.passwordField);
this._updateLogin(selectedLogin, newLoginWithUsername);
}
},