fix: pass authConfigs in getConnectors for custom OAuth connections

Merged
SW
8mo ago
+45-0

Summary

  • Connections created with custom auth configs (TikTok, Instagram) were invisible to getConnectors because it created Composio sessions without matching authConfigs
  • Composio scopes connection lookups by auth config — if you authorize with a custom config, you must query with the same config
  • Added buildAuthConfigs() helper that reads COMPOSIO_TIKTOK_AUTH_CONFIG_ID and COMPOSIO_INSTAGRAM_AUTH_CONFIG_ID from env vars

Test plan

  • Added failing test first (TDD red) — verified getConnectors did NOT pass authConfigs
  • Applied fix (TDD green) — test passes
  • Existing tests still pass (no regression)
  • Verify on preview: GET /api/connectors?account_id=9105f630-8e9f-4908-a2c4-3f68a6454c78 returns isConnected: true for TikTok/Instagram

šŸ¤– Generated with Claude Code


Summary by cubic

Fixes getConnectors so TikTok and Instagram connections authorized with custom OAuth are returned. We now pass matching authConfigs from env vars when creating the Composio session.

  • Bug Fixes

    • Pass authConfigs to the Composio session in getConnectors.
    • Extract buildAuthConfigs() module; reads COMPOSIO_TIKTOK_AUTH_CONFIG_ID and COMPOSIO_INSTAGRAM_AUTH_CONFIG_ID.
    • Tests: cover custom OAuth; fix env var cleanup with try/finally.
  • Migration

    • If you use custom TikTok/Instagram OAuth, set the env vars above. No action needed otherwise.

Summary by CodeRabbit

  • New Features
    • Added support for configuring TikTok and Instagram connector authentication through environment variables, enabling automatic authentication configuration when initializing these connectors.