mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 399703 - Password manager offers to store logins with empty passwords. r=gavin
This commit is contained in:
parent
b371c503be
commit
f2847be93e
@ -268,6 +268,11 @@ LoginManagerPrompter.prototype = {
|
||||
if (!ok || !checkBox.value || !hostname)
|
||||
return ok;
|
||||
|
||||
if (!aPassword.value) {
|
||||
this.log("No password entered, so won't offer to save.");
|
||||
return ok;
|
||||
}
|
||||
|
||||
var newLogin = Cc["@mozilla.org/login-manager/loginInfo;1"].
|
||||
createInstance(Ci.nsILoginInfo);
|
||||
newLogin.init(hostname, null, realm, aUsername.value, aPassword.value,
|
||||
@ -350,7 +355,7 @@ LoginManagerPrompter.prototype = {
|
||||
aText, aPassword,
|
||||
checkBoxLabel, checkBox);
|
||||
|
||||
if (ok && checkBox.value && hostname) {
|
||||
if (ok && checkBox.value && hostname && aPassword.value) {
|
||||
var newLogin = Cc["@mozilla.org/login-manager/loginInfo;1"].
|
||||
createInstance(Ci.nsILoginInfo);
|
||||
newLogin.init(hostname, null, realm, username,
|
||||
@ -468,6 +473,11 @@ LoginManagerPrompter.prototype = {
|
||||
try {
|
||||
var [username, password] = this._GetAuthInfo(aAuthInfo);
|
||||
|
||||
if (!password) {
|
||||
this.log("No password entered, so won't offer to save.");
|
||||
return ok;
|
||||
}
|
||||
|
||||
var newLogin = Cc["@mozilla.org/login-manager/loginInfo;1"].
|
||||
createInstance(Ci.nsILoginInfo);
|
||||
newLogin.init(hostname, null, httpRealm,
|
||||
|
Loading…
Reference in New Issue
Block a user