mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
⚡ Improvements to Drift-Node
This commit is contained in:
@@ -15,7 +15,7 @@ export class DriftOAuth2Api implements ICredentialType {
|
||||
displayName: 'Authorization URL',
|
||||
name: 'authUrl',
|
||||
type: 'hidden' as NodePropertyTypes,
|
||||
default: 'ttps://dev.drift.com/authorize',
|
||||
default: 'https://dev.drift.com/authorize',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
@@ -31,6 +31,12 @@ export class DriftOAuth2Api implements ICredentialType {
|
||||
type: 'hidden' as NodePropertyTypes,
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'Scope',
|
||||
name: 'scope',
|
||||
type: 'hidden' as NodePropertyTypes,
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'Authentication',
|
||||
name: 'authentication',
|
||||
|
||||
@@ -46,8 +46,9 @@ export async function driftApiRequest(this: IExecuteFunctions | IWebhookFunction
|
||||
return await this.helpers.requestOAuth2!.call(this, 'driftOAuth2Api', options);
|
||||
}
|
||||
} catch (error) {
|
||||
if (error.response) {
|
||||
const errorMessage = error.message || (error.response.body && error.response.body.message );
|
||||
|
||||
if (error.response && error.response.body && error.response.body.error) {
|
||||
const errorMessage = error.response.body.error.message;
|
||||
throw new Error(`Drift error response [${error.statusCode}]: ${errorMessage}`);
|
||||
}
|
||||
throw error;
|
||||
|
||||
Reference in New Issue
Block a user