Skip to content

Let META_PLATFORM_ORG_IDS limit the server's Meta app to some organizations - #1660

Merged
helpcodeai merged 1 commit into
mainfrom
feat/meta-platform-org-allowlist
Nov 13, 2026
Merged

helpcodeai merged 1 commit into
mainfrom
feat/meta-platform-org-allowlist

Conversation

@helpcodeai

Copy link
Copy Markdown
Contributor

Summary

The server's Meta app (META_PLATFORM_*) gives the Instagram connector a one-click sign-in. While that app is in Development mode or in App Review, only its testers can finish the sign-in: on Cloud, customers started it 39 times in two days and none completed.

New optional variable META_PLATFORM_ORG_IDS (comma-separated organization ids). Empty or unset: nothing changes. With a list, the server's app is offered only to those organizations; every other organization sees the Instagram connector as on a server without an app: the setup page asks for an app of its own (or a pasted token), and POST /api/meta/connectors/:id/authorize answers with the variables to set. A connector with an app of its own is never affected.

Cloud and self-hosted behave the same; the variable is unset by default in both.

Changes

  • meta-login.util.ts: metaPlatformAppOpenTo(organizationId); metaLoginAppOf takes the connector's organization id and skips the server's app when it is not open to it.
  • meta-auth.controller.ts: GET /api/meta/platform answers for the caller's organization; authorize, complete and the account list pass the connector's organization.
  • docker-compose.yml, docker-compose.cloud.yml, .env.example, docs/deployment.md (+ regenerated llms-full.txt).

No change in ee/. No schema change. The check uses req.user.organizationId and connector.organizationId, which the endpoints already compare.

Type

  • Bug fix
  • New feature
  • Documentation
  • Refactoring
  • Performance improvement
  • Other (describe below)

Testing

  • Added/updated unit tests
  • Tested manually (describe steps below)
  • No tests needed (explain why)

packages/backend, after npm ci (root) and npx prisma generate:

  • npx jest src/connectors/meta-auth src/connectors/engines/meta-login src/connectors/engines/bearer-token src/adapters/intl/instagram --maxWorkers=4: 6 suites passed; 82 tests passed, 3 skipped (live calls).
  • npx tsc --noEmit -p tsconfig.json: no errors. npx eslint on the four files: clean.
  • Root: node scripts/generate-llms-txt.mjs.

Checklist

  • My code follows the existing code style
  • I have tested my changes locally
  • I have updated documentation (if applicable)
  • All existing tests pass (npm test) (Meta suites locally, full suite in CI)
  • This PR has a descriptive title

Related Issues

Follow-up to #1630.

@helpcodeai
helpcodeai merged commit 46698c9 into main Nov 13, 2026
17 checks passed
@helpcodeai
helpcodeai deleted the feat/meta-platform-org-allowlist branch November 13, 2026 14:11
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant