diff --git a/packages/editor-ui/src/Interface.ts b/packages/editor-ui/src/Interface.ts index 10457c8c41..d2d9287df9 100644 --- a/packages/editor-ui/src/Interface.ts +++ b/packages/editor-ui/src/Interface.ts @@ -145,6 +145,7 @@ export interface INodeUi extends INode { notes?: string; issues?: INodeIssues; name: string; + activeCredentialType?: string; } export interface INodeTypesMaxCount { diff --git a/packages/editor-ui/src/components/NodeCredentials.vue b/packages/editor-ui/src/components/NodeCredentials.vue index 3f9d33452d..4fbc53d7f7 100644 --- a/packages/editor-ui/src/components/NodeCredentials.vue +++ b/packages/editor-ui/src/components/NodeCredentials.vue @@ -216,6 +216,8 @@ export default mixins( }, }; + delete this.node.activeCredentialType; + this.$emit('credentialSelected', updateInformation); }, @@ -272,6 +274,8 @@ export default mixins( }, }; + this.node.activeCredentialType = credentialType; + this.$emit('credentialSelected', updateInformation); }, diff --git a/packages/editor-ui/src/components/ParameterInput.vue b/packages/editor-ui/src/components/ParameterInput.vue index a3f6d64738..a733569fe5 100644 --- a/packages/editor-ui/src/components/ParameterInput.vue +++ b/packages/editor-ui/src/components/ParameterInput.vue @@ -601,14 +601,9 @@ export default mixins( * Whether the node's credential may be used to make a request with the HTTP Request node. */ isSupportedByHttpRequestNode(): boolean { - if (!this.node || !this.node.credentials) return false; + if (!this.node || !this.node.activeCredentialType || !this.node.credentials) return false; - // @TODO Detect currently selected cred - const selectedCredentialTypeName = Object.keys(this.node.credentials); - if (!selectedCredentialTypeName.length) return false; - const name = selectedCredentialTypeName.pop()!; - - const credentialType = this.getCredentialTypeByName(name); + const credentialType = this.getCredentialTypeByName(this.node.activeCredentialType); return ( credentialType.name.slice(0, -4).endsWith('OAuth') ||