From f01138474d5a7812277171d9f955f7bdaff896bb Mon Sep 17 00:00:00 2001 From: Head of Product & Engineering Date: Mon, 6 Apr 2026 09:54:41 +0200 Subject: [PATCH] debug: log full token response body and callback query params Temporary diagnostic logging to determine what GHL includes in the token exchange response and the OAuth callback redirect URL when user_type is Company (Sub-account target app, agency-level install). Co-Authored-By: Paperclip --- internal/ghl/oauth.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/ghl/oauth.go b/internal/ghl/oauth.go index 2536b2a..19e6b86 100644 --- a/internal/ghl/oauth.go +++ b/internal/ghl/oauth.go @@ -81,6 +81,7 @@ func (h *OAuthHandler) HandleCallback(w http.ResponseWriter, r *http.Request) { http.Error(w, "missing authorization code", http.StatusBadRequest) return } + slog.Info("ghl oauth callback query params", "params", r.URL.RawQuery) ctx := r.Context() tokenResp, err := h.exchangeCode(ctx, code) @@ -202,6 +203,6 @@ func (h *OAuthHandler) postToken(ctx context.Context, data url.Values) (*TokenRe if err := json.Unmarshal(body, &tokenResp); err != nil { return nil, fmt.Errorf("failed to parse token response: %w", err) } - slog.Info("ghl token response fields", "location_id", tokenResp.LocationID, "company_id", tokenResp.CompanyID, "user_type", tokenResp.UserType) + slog.Info("ghl token response fields", "location_id", tokenResp.LocationID, "company_id", tokenResp.CompanyID, "user_type", tokenResp.UserType, "raw_body", string(body)) return &tokenResp, nil }