{"record":{"id":"ba758c742aaf11f7","repo":"gitroomhq/postiz-app","slug":"organization-not-found","errorCode":null,"errorMessage":"Organization not found","messagePattern":"Organization not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/backend/src/api/routes/enterprise.controller.ts","lineNumber":63,"sourceCode":"  @Post('/url')\n  async redirectParams(@Body('params') params: string) {\n    try {\n      const load = AuthService.verifyJWT(params) as {\n        redirectUrl: string;\n        apiKey: string;\n        refreshId?: string;\n        provider: string;\n        webhookUrl: string;\n      };\n\n      if (!load || !load.redirectUrl || !load.apiKey || !load.provider) {\n        return;\n      }\n\n      const org = await this._organizationService.getOrgByApiKey(load.apiKey);\n\n      if (!org) {\n        throw new Error('Organization not found');\n      }\n\n      if (\n        !this._integrationManager\n          .getAllowedSocialsIntegrations()\n          .includes(load.provider)\n      ) {\n        throw new Error('Integration not allowed');\n      }\n\n      const integrationProvider = this._integrationManager.getSocialIntegration(\n        load.provider\n      );\n\n      const { codeVerifier, state, url } =\n        await integrationProvider.generateAuthUrl();\n\n      if (load.refreshId) {","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/gitroomhq/postiz-app/blob/0f1647f7491a217d43eb5ae7a480484bdf0aff3e/apps/backend/src/api/routes/enterprise.controller.ts#L45-L81","documentation":"During the enterprise OAuth redirect, after the org is resolved, the provider in the payload is checked against integrationManager.getAllowedSocialsIntegrations(). If the provider identifier is not in the allowed list, Error('Integration not allowed') is thrown (surfaces as 500).","triggerScenarios":"Redirect token contains a provider that is disabled in this deployment's integration configuration (e.g. a provider removed via env flags or not licensed), or a misspelled/renamed provider identifier.","commonSituations":"Self-hosted deployment that disabled certain integrations via PROVIDERS/env config; provider renamed across Postiz versions leaving stale tokens; enterprise token generated against a different allowlist.","solutions":["Check the deployment's integration allowlist configuration and enable the provider","Confirm the provider identifier in the redirect payload matches the current provider name exactly","Regenerate the enterprise redirect token after provider config changes","Return 400/403 from the route instead of a bare Error"],"exampleFix":"// before\nthrow new Error('Integration not allowed');\n// after\nthrow new HttpException('Integration not allowed', HttpStatus.BAD_REQUEST);","handlingStrategy":"validation","validationCode":"const allowed = await getAllowedProviders();\nif (!allowed.includes(payload.provider)) throw new Error(`Provider ${payload.provider} not enabled`);","typeGuard":"const isAllowedProvider = (p: string, allowed: string[]) => allowed.includes(p);","tryCatchPattern":"try { await enterpriseRedirect(token); } catch (e) { if (e.message === 'Integration not allowed') surfaceProviderConfigIssue(); else throw e; }","preventionTips":["Keep provider allowlists in sync across environments","Regenerate redirect tokens after provider configuration changes"],"tags":["enterprise","integrations","provider","allowlist","oauth"],"backgroundTag":"provider-not-allowed","analyzedSha":"0f1647f7491a217d43eb5ae7a480484bdf0aff3e","analyzedAt":"2026-08-27T12:09:55.020Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}