diff --git a/packages/api/src/@core/connections/crm/services/hubspot/hubspot.service.ts b/packages/api/src/@core/connections/crm/services/hubspot/hubspot.service.ts index 27b5ee824..acbed393c 100644 --- a/packages/api/src/@core/connections/crm/services/hubspot/hubspot.service.ts +++ b/packages/api/src/@core/connections/crm/services/hubspot/hubspot.service.ts @@ -56,7 +56,11 @@ export class HubspotConnectionService implements ICrmConnectionService { }); if (isNotUnique) return; //reconstruct the redirect URI that was passed in the frontend it must be the same - const REDIRECT_URI = `${this.env.getPanoraBaseUrl()}/connections/oauth/callback`; + const REDIRECT_URI = `${ + this.env.getDistributionMode() == 'selfhost' + ? this.env.getWebhookIngress() + : this.env.getPanoraBaseUrl() + }/connections/oauth/callback`; const CREDENTIALS = (await this.cService.getCredentials( projectId, diff --git a/packages/shared/src/connectors/metadata.ts b/packages/shared/src/connectors/metadata.ts index 0ca514e06..d5074c6bc 100644 --- a/packages/shared/src/connectors/metadata.ts +++ b/packages/shared/src/connectors/metadata.ts @@ -6,7 +6,7 @@ import { AuthStrategy, ProvidersConfig } from '../types'; export const CONNECTORS_METADATA: ProvidersConfig = { 'crm': { 'hubspot': { - scopes: 'crm.objects.companies.read crm.objects.companies.write crm.objects.contacts.read crm.objects.contacts.write crm.objects.deals.read crm.objects.deals.write crm.objects.custom.read crm.objects.custom.write crm.objects.leads.read crm.objects.leads.write crm.objects.owners.read crm.objects.users.read crm.objects.users.write sales-email-read', + scopes: 'crm.objects.companies.read crm.objects.companies.write crm.objects.contacts.read crm.objects.contacts.write crm.objects.deals.read crm.objects.deals.write crm.objects.custom.read crm.objects.custom.write crm.objects.leads.read crm.objects.leads.write crm.objects.owners.read crm.objects.users.read crm.objects.users.write oauth sales-email-read', urls: { docsUrl: 'https://developers.hubspot.com/docs/api/crm/understanding-the-crm', authBaseUrl: 'https://app-eu1.hubspot.com/oauth/authorize',