Skip to content

Commit

Permalink
fix(Fix Rocketchat Node): Fix authentication issue (#3778)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joffcom authored Jul 27, 2022
1 parent 2e194a6 commit 2710061
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/nodes-base/nodes/Rocketchat/GenericFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ import {

import {
IExecuteFunctions,
IHookFunctions,
ILoadOptionsFunctions,
} from 'n8n-core';
import { NodeApiError, NodeOperationError, } from 'n8n-workflow';
import { NodeApiError } from 'n8n-workflow';

export async function rocketchatApiRequest(this: IExecuteFunctions | ILoadOptionsFunctions, resource: string, method: string, operation: string, body: any = {}, headers?: object): Promise<any> { // tslint:disable-line:no-any
const credentials = await this.getCredentials('rocketchatApi');
Expand All @@ -23,7 +22,7 @@ export async function rocketchatApiRequest(this: IExecuteFunctions | ILoadOption
delete options.body;
}
try {
return await this.helpers.request!(options);
return await this.helpers.requestWithAuthentication.call(this, 'rocketchatApi', options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}
Expand Down

0 comments on commit 2710061

Please sign in to comment.