mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-21 20:00:02 +00:00
feat(HighLevel Node): Api v2 support, new node version (#9554)
This commit is contained in:
@@ -149,3 +149,10 @@ export const TEST_WEBHOOK_TIMEOUT = 2 * TIME.MINUTE;
|
||||
export const TEST_WEBHOOK_TIMEOUT_BUFFER = 30 * TIME.SECOND;
|
||||
|
||||
export const N8N_DOCS_URL = 'https://docs.n8n.io';
|
||||
|
||||
export const GENERIC_OAUTH2_CREDENTIALS_WITH_EDITABLE_SCOPE = [
|
||||
'oAuth2Api',
|
||||
'googleOAuth2Api',
|
||||
'microsoftOAuth2Api',
|
||||
'highLevelOAuth2Api',
|
||||
];
|
||||
|
||||
@@ -10,6 +10,7 @@ import { Get, RestController } from '@/decorators';
|
||||
import { jsonStringify } from 'n8n-workflow';
|
||||
import { OAuthRequest } from '@/requests';
|
||||
import { AbstractOAuthController, type CsrfStateParam } from './abstractOAuth.controller';
|
||||
import { GENERIC_OAUTH2_CREDENTIALS_WITH_EDITABLE_SCOPE as GENERIC_OAUTH2_CREDENTIALS_WITH_EDITABLE_SCOPE } from '../../constants';
|
||||
|
||||
@RestController('/oauth2-credential')
|
||||
export class OAuth2CredentialController extends AbstractOAuthController {
|
||||
@@ -25,16 +26,11 @@ export class OAuth2CredentialController extends AbstractOAuthController {
|
||||
// At some point in the past we saved hidden scopes to credentials (but shouldn't)
|
||||
// Delete scope before applying defaults to make sure new scopes are present on reconnect
|
||||
// Generic Oauth2 API is an exception because it needs to save the scope
|
||||
const genericOAuth2 = [
|
||||
'oAuth2Api',
|
||||
'googleOAuth2Api',
|
||||
'microsoftOAuth2Api',
|
||||
'highLevelOAuth2Api',
|
||||
];
|
||||
|
||||
if (
|
||||
decryptedDataOriginal?.scope &&
|
||||
credential.type.includes('OAuth2') &&
|
||||
!genericOAuth2.includes(credential.type)
|
||||
!GENERIC_OAUTH2_CREDENTIALS_WITH_EDITABLE_SCOPE.includes(credential.type)
|
||||
) {
|
||||
delete decryptedDataOriginal.scope;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user