diff --git a/packages/editor-ui/src/views/NodeView.vue b/packages/editor-ui/src/views/NodeView.vue index ad77c3a33b421..f24835ff5a324 100644 --- a/packages/editor-ui/src/views/NodeView.vue +++ b/packages/editor-ui/src/views/NodeView.vue @@ -1393,7 +1393,6 @@ export default mixins( await this.loadNodesProperties([newNodeData].map(node => ({name: node.type, version: node.typeVersion}))); const nodeType = this.$store.getters['nodeTypes/getNodeType'](newNodeData.type, newNodeData.typeVersion) as INodeTypeDescription; - const nodeParameters = NodeHelpers.getNodeParameters(nodeType.properties, {}, true, false, newNodeData); if (nodeTypeData.credentials) { const authentication = nodeTypeData.credentials.find(type => type.name === defaultCredential.type); @@ -1407,25 +1406,21 @@ export default mixins( return newNodeData; } + // ignore complex case when there's multiple dependencies if (Object.keys(authDisplayOptions).length === 1 && authDisplayOptions['authentication']) { - // ignore complex case when there's multiple dependencies + const authProperty = (nodeType.properties || []).find((property) => property.name === 'authentication'); + + // ignore complex case when auth has dependencies + if (authProperty?.displayOptions) { + return newNodeData; + } + newNodeData.credentials = credentials; - let parameters: { [key:string]: string } = {}; - for (const displayOption of Object.keys(authDisplayOptions)) { - if (nodeParameters && !nodeParameters[displayOption]) { - parameters = {}; - newNodeData.credentials = undefined; - break; - } - const optionValue = get(authentication, `displayOptions.show[${displayOption}][0]`); - if (optionValue) { - parameters[displayOption] = optionValue; - } - newNodeData.parameters = { - ...newNodeData.parameters, - ...parameters, - }; + // set authentication parameter value + const optionValue = authDisplayOptions?.authentication[0]; + if (optionValue) { + newNodeData.parameters.authentication = optionValue; } } }