mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
⚡ Fix rendering for generic auth creds
This commit is contained in:
parent
81aeefa715
commit
3d5b92b009
|
@ -77,6 +77,7 @@ import { showMessage } from '@/components/mixins/showMessage';
|
||||||
import { mapGetters } from "vuex";
|
import { mapGetters } from "vuex";
|
||||||
|
|
||||||
import mixins from 'vue-typed-mixins';
|
import mixins from 'vue-typed-mixins';
|
||||||
|
import { HTTP_REQUEST_NODE_TYPE } from '@/constants';
|
||||||
|
|
||||||
export default mixins(
|
export default mixins(
|
||||||
genericHelpers,
|
genericHelpers,
|
||||||
|
@ -97,13 +98,17 @@ export default mixins(
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters('credentials', {
|
...mapGetters('credentials', {
|
||||||
credentialOptions: 'allCredentialsByType',
|
credentialOptions: 'allCredentialsByType',
|
||||||
|
getCredentialTypeByName: 'getCredentialTypeByName',
|
||||||
}),
|
}),
|
||||||
isProxyCredentialType(): boolean {
|
isProxyAuth(): boolean {
|
||||||
const proxyCredentialNodeTypes = ["n8n-nodes-base.httpRequest"];
|
return this.node.type === HTTP_REQUEST_NODE_TYPE
|
||||||
|
&& this.node.typeVersion === 2
|
||||||
return proxyCredentialNodeTypes.includes(this.node.type)
|
&& this.node.parameters.authenticateWith === 'nodeCredential';
|
||||||
&& this.node.parameters.authenticateWith === 'nodeCredential'
|
},
|
||||||
&& this.node.parameters.nodeCredentialType;
|
isGenericAuth(): boolean {
|
||||||
|
return this.node.type === HTTP_REQUEST_NODE_TYPE
|
||||||
|
&& this.node.typeVersion === 2
|
||||||
|
&& this.node.parameters.authenticateWith === 'genericAuth';
|
||||||
},
|
},
|
||||||
credentialTypesNode (): string[] {
|
credentialTypesNode (): string[] {
|
||||||
return this.credentialTypesNodeDescription
|
return this.credentialTypesNodeDescription
|
||||||
|
@ -118,8 +123,16 @@ export default mixins(
|
||||||
credentialTypesNodeDescription (): INodeCredentialDescription[] {
|
credentialTypesNodeDescription (): INodeCredentialDescription[] {
|
||||||
const node = this.node as INodeUi;
|
const node = this.node as INodeUi;
|
||||||
|
|
||||||
if (this.isProxyCredentialType) {
|
if (this.isGenericAuth) {
|
||||||
return [this.$store.getters['credentials/getCredentialTypeByName'](this.node.parameters.nodeCredentialType)];
|
const { genericAuthType } = this.node.parameters as { genericAuthType: string };
|
||||||
|
|
||||||
|
return [this.getCredentialTypeByName(genericAuthType)];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.isProxyAuth) {
|
||||||
|
const { nodeCredentialType } = this.node.parameters as { nodeCredentialType?: string };
|
||||||
|
|
||||||
|
if (nodeCredentialType) return [this.getCredentialTypeByName(nodeCredentialType)];
|
||||||
}
|
}
|
||||||
|
|
||||||
const activeNodeType = this.$store.getters.nodeType(node.type, node.typeVersion) as INodeTypeDescription | null;
|
const activeNodeType = this.$store.getters.nodeType(node.type, node.typeVersion) as INodeTypeDescription | null;
|
||||||
|
|
Loading…
Reference in a new issue