gitroomhq/postiz-app · error · Error

Integration not allowed

Error message

Integration not allowed

What it means

Some providers (self-hosted/enterprise variants of Reddit, Mastodon, etc.) require an external instance URL before OAuth can start. If the provider class defines externalUrl and the caller did not supply one, Error('Missing external url') is thrown.

Source

Thrown at apps/backend/src/api/routes/integrations.controller.ts:211

    );
  }

  @Get('/social/:integration')
  @CheckPolicies([AuthorizationActions.Create, Sections.CHANNEL])
  async getIntegrationUrl(
    @Param('integration') integration: string,
    @Query('refresh') refresh: string,
    @Query('externalUrl') externalUrl: string,
    @Query('redirectUrl') redirectUrl: string,
    @Query('onboarding') onboarding: string,
    @GetOrgFromRequest() org: Organization
  ) {
    if (
      !this._integrationManager
        .getAllowedSocialsIntegrations()
        .includes(integration)
    ) {
      throw new Error('Integration not allowed');
    }

    // A provider migrated via MIGRATE_PROVIDERS reconnects through its target
    // provider's OAuth: the callback lands on the target and the channel is
    // migrated in place (see migrateIntegration).
    const migrateTo = refresh
      ? this._integrationManager.getMigrationTarget(integration)
      : undefined;

    const integrationProvider = this._integrationManager.getSocialIntegration(
      migrateTo || integration
    );

    if (integrationProvider.externalUrl && !externalUrl) {
      throw new Error('Missing external url');
    }

    try {

View on GitHub (pinned to 0f1647f749)

Solutions

  1. Collect and pass the external instance URL when connecting providers that require it (e.g. https://mastodon.social)
  2. Validate the field is non-empty in the UI before starting the OAuth flow
  3. Trim input to avoid whitespace-only submissions

Example fix

// before
openIntegrationUrl('mastodon');
// after
const url = instanceInput.trim();
if (!url) return showError('Instance URL is required');
openIntegrationUrl('mastodon', { externalUrl: url });
Defensive patterns

Strategy: validation

Validate before calling

const url = (externalUrl ?? '').trim();
if (requiresExternalUrl(provider) && !url) { flagField('externalUrl'); return; }

Type guard

const isNonEmptyUrl = (v: string | undefined | null): v is string => Boolean(v && v.trim().length > 0);

Try / catch

try { await connect(provider); } catch (e) { if (e.message === 'Missing external url') focusInstanceInput(); else throw e; }

Prevention

When it happens

Trigger: Initiating a connect flow for a provider that implements externalUrl without passing the externalUrl query/body parameter — e.g. connecting a self-hosted Mastodon without entering the instance domain.

Common situations: Frontend form skipping the 'instance URL' input; generic connect button used for a provider that needs per-user server address; whitespace-only URL string passed.

Understand the failure class

Background: Missing required parameter errors: what 'X is required' and 'the required X param is missing' mean, and how to fix them — this error's family across 27 libraries.

Related errors


AI-assisted analysis of gitroomhq/postiz-app@0f1647f749 (2026-08-27). Data as JSON: /api/errors/2839313a7d7b83ac. Report an issue: GitHub.