mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Fix save and history of credentials for panes
This commit is contained in:
parent
cb0c484579
commit
eab512ef22
@ -131,9 +131,13 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (node._def.credentials) {
|
if (node._def.credentials) {
|
||||||
var credDefinition = node._def.credentials;
|
const credsDefinition = node._def.credentials;
|
||||||
var credsChanged = updateNodeCredentials(node,credDefinition,this.inputClass);
|
const credsChanged = updateNodeCredentials(node, credsDefinition, this.inputClass);
|
||||||
editState.changed = editState.changed || credsChanged;
|
|
||||||
|
if (credsChanged) {
|
||||||
|
editState.changed = true;
|
||||||
|
editState.changes.credentials = node.credentials._;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -178,11 +182,14 @@
|
|||||||
var value = input.val();
|
var value = input.val();
|
||||||
if (credDefinition[cred].type == 'password') {
|
if (credDefinition[cred].type == 'password') {
|
||||||
node.credentials['has_' + cred] = (value !== "");
|
node.credentials['has_' + cred] = (value !== "");
|
||||||
if (value == '__PWRD__') {
|
|
||||||
|
// Skip if the credential has not changed
|
||||||
|
if ((value === '__PWRD__' && node.credentials._['has_' + cred] === true) ||
|
||||||
|
(value === "" && node.credentials._['has_' + cred] === false)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
changed = true;
|
|
||||||
|
|
||||||
|
changed = true;
|
||||||
}
|
}
|
||||||
node.credentials[cred] = value;
|
node.credentials[cred] = value;
|
||||||
if (value != node.credentials._[cred]) {
|
if (value != node.credentials._[cred]) {
|
||||||
@ -193,6 +200,4 @@
|
|||||||
}
|
}
|
||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user