mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-09 22:24:05 -08:00
fix(HTTP Request Node): Fix sending previously selected credentials also on V2 (#4457)
This commit is contained in:
parent
44ad249827
commit
02fe545967
|
@ -627,24 +627,33 @@ export class HttpRequestV2 implements INodeType {
|
|||
let nodeCredentialType;
|
||||
|
||||
if (authentication === 'genericCredentialType') {
|
||||
try {
|
||||
httpBasicAuth = await this.getCredentials('httpBasicAuth');
|
||||
} catch (_) {}
|
||||
try {
|
||||
httpDigestAuth = await this.getCredentials('httpDigestAuth');
|
||||
} catch (_) {}
|
||||
try {
|
||||
httpHeaderAuth = await this.getCredentials('httpHeaderAuth');
|
||||
} catch (_) {}
|
||||
try {
|
||||
httpQueryAuth = await this.getCredentials('httpQueryAuth');
|
||||
} catch (_) {}
|
||||
try {
|
||||
oAuth1Api = await this.getCredentials('oAuth1Api');
|
||||
} catch (_) {}
|
||||
try {
|
||||
oAuth2Api = await this.getCredentials('oAuth2Api');
|
||||
} catch (_) {}
|
||||
const genericAuthType = this.getNodeParameter('genericAuthType', 0) as string;
|
||||
|
||||
if (genericAuthType === 'httpBasicAuth') {
|
||||
try {
|
||||
httpBasicAuth = await this.getCredentials('httpBasicAuth');
|
||||
} catch (_) {}
|
||||
} else if (genericAuthType === 'httpDigestAuth') {
|
||||
try {
|
||||
httpDigestAuth = await this.getCredentials('httpDigestAuth');
|
||||
} catch (_) {}
|
||||
} else if (genericAuthType === 'httpHeaderAuth') {
|
||||
try {
|
||||
httpHeaderAuth = await this.getCredentials('httpHeaderAuth');
|
||||
} catch (_) {}
|
||||
} else if (genericAuthType === 'httpQueryAuth') {
|
||||
try {
|
||||
httpQueryAuth = await this.getCredentials('httpQueryAuth');
|
||||
} catch (_) {}
|
||||
} else if (genericAuthType === 'oAuth1Api') {
|
||||
try {
|
||||
oAuth1Api = await this.getCredentials('oAuth1Api');
|
||||
} catch (_) {}
|
||||
} else if (genericAuthType === 'oAuth2Api') {
|
||||
try {
|
||||
oAuth2Api = await this.getCredentials('oAuth2Api');
|
||||
} catch (_) {}
|
||||
}
|
||||
} else if (authentication === 'predefinedCredentialType') {
|
||||
try {
|
||||
nodeCredentialType = this.getNodeParameter('nodeCredentialType', 0) as string;
|
||||
|
|
Loading…
Reference in a new issue