Repository navigation
Let META_PLATFORM_ORG_IDS limit the server's Meta app to some organizations - #1660
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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), andPOST /api/meta/connectors/:id/authorizeanswers 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);metaLoginAppOftakes 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/platformanswers 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(+ regeneratedllms-full.txt).No change in
ee/. No schema change. The check usesreq.user.organizationIdandconnector.organizationId, which the endpoints already compare.Type
Testing
packages/backend, afternpm ci(root) andnpx 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 eslinton the four files: clean.node scripts/generate-llms-txt.mjs.Checklist
npm test) (Meta suites locally, full suite in CI)Related Issues
Follow-up to #1630.