Skip to content

Commit

Permalink
fix(editor): Fix problem with HTTP Request Node 1 credentials to be s…
Browse files Browse the repository at this point in the history
…et (#3371)
  • Loading branch information
mutdmour authored May 24, 2022
1 parent e5d9a7b commit c5fc3bc
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions packages/editor-ui/src/components/mixins/workflowHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,23 +330,24 @@ export const workflowHelpers = mixins(
if (node.credentials !== undefined && nodeType.credentials !== undefined) {
const saveCredenetials: INodeCredentials = {};
for (const nodeCredentialTypeName of Object.keys(node.credentials)) {
if (this.hasProxyAuth(node) || Object.keys(node.parameters).includes('genericAuthType')) {
saveCredenetials[nodeCredentialTypeName] = node.credentials[nodeCredentialTypeName];
continue;
}

const credentialTypeDescription = nodeType.credentials
.find((credentialTypeDescription) => credentialTypeDescription.name === nodeCredentialTypeName);

if (credentialTypeDescription === undefined) {
// Credential type is not know so do not save
continue;
}

if (this.displayParameter(node.parameters, credentialTypeDescription, '', node) === false) {
// Credential should not be displayed so do also not save
continue;
}
// todo revert to only set actually used credentials on workflow
// if (this.hasProxyAuth(node) || Object.keys(node.parameters).includes('genericAuthType')) {
// saveCredenetials[nodeCredentialTypeName] = node.credentials[nodeCredentialTypeName];
// continue;
// }

// const credentialTypeDescription = nodeType.credentials
// .find((credentialTypeDescription) => credentialTypeDescription.name === nodeCredentialTypeName);

// if (credentialTypeDescription === undefined) {
// // Credential type is not know so do not save
// continue;
// }

// if (this.displayParameter(node.parameters, credentialTypeDescription, '', node) === false) {
// // Credential should not be displayed so do also not save
// continue;
// }

saveCredenetials[nodeCredentialTypeName] = node.credentials[nodeCredentialTypeName];
}
Expand Down

0 comments on commit c5fc3bc

Please sign in to comment.