fix(HTTP Request Node): Fix sending previously selected credentials also on V2 (#4457)

This commit is contained in:
Jan Oberhauser 2022-10-27 14:40:14 +02:00
parent 44ad249827
commit 02fe545967

View file

@ -627,24 +627,33 @@ export class HttpRequestV2 implements INodeType {
let nodeCredentialType; let nodeCredentialType;
if (authentication === 'genericCredentialType') { if (authentication === 'genericCredentialType') {
const genericAuthType = this.getNodeParameter('genericAuthType', 0) as string;
if (genericAuthType === 'httpBasicAuth') {
try { try {
httpBasicAuth = await this.getCredentials('httpBasicAuth'); httpBasicAuth = await this.getCredentials('httpBasicAuth');
} catch (_) {} } catch (_) {}
} else if (genericAuthType === 'httpDigestAuth') {
try { try {
httpDigestAuth = await this.getCredentials('httpDigestAuth'); httpDigestAuth = await this.getCredentials('httpDigestAuth');
} catch (_) {} } catch (_) {}
} else if (genericAuthType === 'httpHeaderAuth') {
try { try {
httpHeaderAuth = await this.getCredentials('httpHeaderAuth'); httpHeaderAuth = await this.getCredentials('httpHeaderAuth');
} catch (_) {} } catch (_) {}
} else if (genericAuthType === 'httpQueryAuth') {
try { try {
httpQueryAuth = await this.getCredentials('httpQueryAuth'); httpQueryAuth = await this.getCredentials('httpQueryAuth');
} catch (_) {} } catch (_) {}
} else if (genericAuthType === 'oAuth1Api') {
try { try {
oAuth1Api = await this.getCredentials('oAuth1Api'); oAuth1Api = await this.getCredentials('oAuth1Api');
} catch (_) {} } catch (_) {}
} else if (genericAuthType === 'oAuth2Api') {
try { try {
oAuth2Api = await this.getCredentials('oAuth2Api'); oAuth2Api = await this.getCredentials('oAuth2Api');
} catch (_) {} } catch (_) {}
}
} else if (authentication === 'predefinedCredentialType') { } else if (authentication === 'predefinedCredentialType') {
try { try {
nodeCredentialType = this.getNodeParameter('nodeCredentialType', 0) as string; nodeCredentialType = this.getNodeParameter('nodeCredentialType', 0) as string;