mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(Mautic Node): Fix authentication issue (#3761)
* Fixes mautic credential issue * removed unused imports Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
This commit is contained in:
committed by
GitHub
parent
15d8ffd3ba
commit
fe58769b48
@@ -29,8 +29,12 @@ export async function mauticApiRequest(this: IHookFunctions | IExecuteFunctions
|
||||
let returnData;
|
||||
|
||||
if (authenticationMethod === 'credentials') {
|
||||
const credentials = await this.getCredentials('mauticApi');
|
||||
const baseUrl = credentials.url as string;
|
||||
|
||||
options.uri = `${baseUrl.endsWith('/') ? baseUrl.slice(0, -1) : baseUrl}${options.uri}`;
|
||||
//@ts-ignore
|
||||
returnData = await this.helpers.httpRequestWithAuthentication.call(this, 'mauticApi', options);
|
||||
returnData = await this.helpers.requestWithAuthentication.call(this, 'mauticApi', options);
|
||||
} else {
|
||||
const credentials = await this.getCredentials('mauticOAuth2Api');
|
||||
const baseUrl = credentials.url as string;
|
||||
|
||||
Reference in New Issue
Block a user