mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-09 17:50:52 +03:00
fix: Properly iterate over credentials with expressions (#8502)
This commit is contained in:
parent
39e8754784
commit
0e9a5a2ab2
@ -1714,6 +1714,7 @@ export async function requestWithAuthentication(
|
||||
node: INode,
|
||||
additionalData: IWorkflowExecuteAdditionalData,
|
||||
additionalCredentialOptions?: IAdditionalCredentialOptions,
|
||||
itemIndex?: number,
|
||||
) {
|
||||
let credentialsDecrypted: ICredentialDataDecryptedObject | undefined;
|
||||
|
||||
@ -1738,7 +1739,7 @@ export async function requestWithAuthentication(
|
||||
if (additionalCredentialOptions?.credentialsDecrypted) {
|
||||
credentialsDecrypted = additionalCredentialOptions.credentialsDecrypted.data;
|
||||
} else {
|
||||
credentialsDecrypted = await this.getCredentials(credentialsType);
|
||||
credentialsDecrypted = await this.getCredentials(credentialsType, itemIndex);
|
||||
}
|
||||
|
||||
if (credentialsDecrypted === undefined) {
|
||||
@ -3000,6 +3001,7 @@ const getRequestHelperFunctions = (
|
||||
credentialsType,
|
||||
requestOptions,
|
||||
additionalCredentialOptions,
|
||||
itemIndex,
|
||||
): Promise<any> {
|
||||
return await requestWithAuthentication.call(
|
||||
this,
|
||||
@ -3009,6 +3011,7 @@ const getRequestHelperFunctions = (
|
||||
node,
|
||||
additionalData,
|
||||
additionalCredentialOptions,
|
||||
itemIndex,
|
||||
);
|
||||
},
|
||||
|
||||
|
@ -1274,7 +1274,7 @@ export class HttpRequestV3 implements INodeType {
|
||||
oAuth2Api = await this.getCredentials('oAuth2Api', itemIndex);
|
||||
}
|
||||
} else if (authentication === 'predefinedCredentialType') {
|
||||
nodeCredentialType = this.getNodeParameter('nodeCredentialType', 0) as string;
|
||||
nodeCredentialType = this.getNodeParameter('nodeCredentialType', itemIndex) as string;
|
||||
}
|
||||
|
||||
const requestMethod = this.getNodeParameter('method', itemIndex) as string;
|
||||
@ -1714,6 +1714,7 @@ export class HttpRequestV3 implements INodeType {
|
||||
nodeCredentialType,
|
||||
requestOptions,
|
||||
additionalOAuth2Options && { oauth2: additionalOAuth2Options },
|
||||
itemIndex,
|
||||
);
|
||||
requestWithAuthentication.catch(() => {});
|
||||
requestPromises.push(requestWithAuthentication);
|
||||
|
@ -721,6 +721,7 @@ export interface RequestHelperFunctions {
|
||||
credentialsType: string,
|
||||
requestOptions: OptionsWithUri | RequestPromiseOptions,
|
||||
additionalCredentialOptions?: IAdditionalCredentialOptions,
|
||||
itemIndex?: number,
|
||||
): Promise<any>;
|
||||
|
||||
httpRequest(requestOptions: IHttpRequestOptions): Promise<any>;
|
||||
|
Loading…
Reference in New Issue
Block a user