mirror of https://github.com/node-red/node-red.git
Add `oneditsave` credentials changes to history
parent
ed4b98b598
commit
966064328f
|
@ -804,6 +804,17 @@ RED.editor = (function() {
|
|||
}
|
||||
}
|
||||
|
||||
const oldCreds = {};
|
||||
if (editing_node._def.credentials) {
|
||||
for (const prop in editing_node._def.credentials) {
|
||||
if (Object.prototype.hasOwnProperty.call(editing_node._def.credentials, prop)) {
|
||||
if (prop in editing_node.credentials) {
|
||||
oldCreds[prop] = editing_node.credentials[prop];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
const rc = editing_node._def.oneditsave.call(editing_node);
|
||||
if (rc === true) {
|
||||
|
@ -835,6 +846,21 @@ RED.editor = (function() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (editing_node._def.credentials) {
|
||||
for (const prop in editing_node._def.credentials) {
|
||||
if (Object.prototype.hasOwnProperty.call(editing_node._def.credentials, prop)) {
|
||||
if (oldCreds[prop] !== editing_node.credentials[prop]) {
|
||||
if (editing_node.credentials[prop] === '__PWRD__') {
|
||||
continue;
|
||||
}
|
||||
editState.changes.credentials = editState.changes.credentials || {};
|
||||
editState.changes.credentials[prop] = oldCreds[prop];
|
||||
editState.changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue