mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Properly handle credentials passed to /flows api
This commit is contained in:
parent
aa5e47b462
commit
101378c625
@ -160,8 +160,15 @@ function setFlows(_config,_credentials,type,muteLog,forceStart,user) {
|
|||||||
var credsDirty;
|
var credsDirty;
|
||||||
|
|
||||||
if (_credentials) {
|
if (_credentials) {
|
||||||
|
credentials.clean(config);
|
||||||
// A full set of credentials have been provided. Use those instead
|
// A full set of credentials have been provided. Use those instead
|
||||||
configSavePromise = credentials.load(_credentials);
|
let credentialSavePromises = [];
|
||||||
|
for (let id in _credentials) {
|
||||||
|
if (_credentials.hasOwnProperty(id)) {
|
||||||
|
credentialSavePromises.push(credentials.add(id,_credentials[id]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
configSavePromise = Promise.all(credentialSavePromises);
|
||||||
credsDirty = true;
|
credsDirty = true;
|
||||||
} else {
|
} else {
|
||||||
// Allow the credential store to remove anything no longer needed
|
// Allow the credential store to remove anything no longer needed
|
||||||
|
Loading…
Reference in New Issue
Block a user