Skip to content

Commit

Permalink
fix(HTTP Request Node): Fix sending previously selected credentials (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
janober committed Oct 27, 2022
1 parent b226aed commit 44ad249
Showing 1 changed file with 27 additions and 18 deletions.
45 changes: 27 additions & 18 deletions packages/nodes-base/nodes/HttpRequest/V3/HttpRequestV3.node.ts
Expand Up @@ -890,24 +890,33 @@ export class HttpRequestV3 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;
Expand Down

0 comments on commit 44ad249

Please sign in to comment.