mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat(Hubspot Node): enable hubspot credentials for http predefined types (#3686)
This commit is contained in:
@@ -44,16 +44,9 @@ export async function hubspotApiRequest(
|
||||
};
|
||||
|
||||
try {
|
||||
if (authenticationMethod === 'apiKey') {
|
||||
const credentials = await this.getCredentials('hubspotApi');
|
||||
|
||||
options.qs.hapikey = credentials.apiKey as string;
|
||||
return await this.helpers.request!(options);
|
||||
} else if (authenticationMethod === 'appToken') {
|
||||
const credentials = await this.getCredentials('hubspotAppToken');
|
||||
|
||||
options.headers!['Authorization'] = `Bearer ${credentials.appToken}`;
|
||||
return await this.helpers.request!(options);
|
||||
if (authenticationMethod === 'apiKey' || authenticationMethod === 'appToken') {
|
||||
const credentialType = authenticationMethod === 'apiKey' ? 'hubspotApi' : 'hubspotAppToken';
|
||||
return this.helpers.requestWithAuthentication.call(this, credentialType, options);
|
||||
} else if (authenticationMethod === 'developerApi') {
|
||||
if (endpoint.includes('webhooks')) {
|
||||
const credentials = await this.getCredentials('hubspotDeveloperApi');
|
||||
|
||||
Reference in New Issue
Block a user