Head of Product & Engineering f97f31c8ac
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
fix: exchange company token for per-location tokens on bulk OAuth install
GHL issues a Company-scoped token (userType=Company) for bulk/agency
installs even when Target User=Sub-account. This fix handles that case:

1. Detect userType=Company in HandleCallback
2. Call GET /locations/search to enumerate all company locations
3. For each location call POST /oauth/locationToken to get a
   Location-scoped token (userType=Location, includes locationId)
4. Store each location token individually in MongoDB

This allows webhook delivery and status updates to work per-location
without requiring the agency admin to re-install per sub-account.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-06 10:02:42 +02:00
2026-04-04 14:57:29 +00:00

cast-ghl-plugin

Description
No description provided
Readme 314 KiB
Languages
Go 98.4%
Shell 0.9%
Dockerfile 0.7%