debug: log full token response body and callback query params
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

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 <noreply@paperclip.ing>
This commit is contained in:
Head of Product & Engineering 2026-04-06 09:54:41 +02:00
parent ffb27acc11
commit f01138474d

View File

@ -81,6 +81,7 @@ func (h *OAuthHandler) HandleCallback(w http.ResponseWriter, r *http.Request) {
http.Error(w, "missing authorization code", http.StatusBadRequest) http.Error(w, "missing authorization code", http.StatusBadRequest)
return return
} }
slog.Info("ghl oauth callback query params", "params", r.URL.RawQuery)
ctx := r.Context() ctx := r.Context()
tokenResp, err := h.exchangeCode(ctx, code) 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 { if err := json.Unmarshal(body, &tokenResp); err != nil {
return nil, fmt.Errorf("failed to parse token response: %w", err) 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 return &tokenResp, nil
} }