mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
⚡ Detect active credential type
This commit is contained in:
parent
4997569eb2
commit
64e08c8fdd
|
@ -145,6 +145,7 @@ export interface INodeUi extends INode {
|
|||
notes?: string;
|
||||
issues?: INodeIssues;
|
||||
name: string;
|
||||
activeCredentialType?: string;
|
||||
}
|
||||
|
||||
export interface INodeTypesMaxCount {
|
||||
|
|
|
@ -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);
|
||||
},
|
||||
|
||||
|
|
|
@ -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') ||
|
||||
|
|
Loading…
Reference in a new issue