Skip to content

fix(hubspot): add missing tickets and oauth scopes to OAuth config#3653

Merged
waleedlatif1 merged 1 commit intostagingfrom
fix/oauth
Mar 18, 2026
Merged

fix(hubspot): add missing tickets and oauth scopes to OAuth config#3653
waleedlatif1 merged 1 commit intostagingfrom
fix/oauth

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • Add missing tickets and oauth scopes to HubSpot OAuth provider config — these are required by the HubSpot app and their absence was causing "Authorization failed because the provided scopes are missing [tickets]" on login
  • Add crm.objects.tickets.write scope to match app config
  • Add scope descriptions for new entries in utils.ts

Type of Change

  • Bug fix

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@cursor
Copy link

cursor bot commented Mar 18, 2026

You have used all Bugbot PR reviews included in your free trial for your GitHub account on this workspace.

To continue using Bugbot reviews, enable Bugbot for your team in the Cursor dashboard.

@vercel
Copy link

vercel bot commented Mar 18, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Mar 18, 2026 5:31pm

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 18, 2026

Greptile Summary

This PR fixes a HubSpot OAuth authorization failure by adding three missing scopes (crm.objects.tickets.write, tickets, and oauth) to the HubSpot provider config in oauth.ts, along with corresponding human-readable descriptions in utils.ts.

Key changes:

  • oauth.ts: Adds crm.objects.tickets.write (granular v3 CRM write scope), tickets (legacy scope required by the HubSpot app), and oauth (required OAuth scope) to the HubSpot scopes array.
  • utils.ts: Adds SCOPE_DESCRIPTIONS entries for all three new scopes, following the established pattern for UI display.

Note: The generic scope keys tickets and oauth in SCOPE_DESCRIPTIONS are shared across all providers in a flat Record<string, string>. Both keys are currently only used by HubSpot in the codebase, so there is no collision at this time — but this is a pre-existing structural limitation worth being aware of as more providers are added.

Confidence Score: 5/5

  • This PR is safe to merge — it is a minimal, targeted bug fix that corrects a well-documented HubSpot OAuth scope issue.
  • The changes are confined to two configuration/utility files, add only additive content (new scope strings and descriptions), and directly address the reported authorization error. No logic, control flow, or existing scopes are modified. There are no regressions possible from purely additive scope additions.
  • No files require special attention.

Important Files Changed

Filename Overview
apps/sim/lib/oauth/oauth.ts Adds three missing HubSpot OAuth scopes: crm.objects.tickets.write, tickets, and oauth. The change is minimal and targeted, directly fixing the described authorization error.
apps/sim/lib/oauth/utils.ts Adds SCOPE_DESCRIPTIONS entries for the three newly added HubSpot scopes. Descriptions follow the existing naming conventions and are accurate.

Sequence Diagram

sequenceDiagram
    participant User
    participant SimApp as Sim App
    participant HubSpot as HubSpot OAuth

    User->>SimApp: Initiate HubSpot OAuth
    SimApp->>HubSpot: Authorization request with scopes
    Note over SimApp,HubSpot: Before fix: missing 'tickets' and 'oauth' scopes
    HubSpot-->>SimApp: ❌ Authorization failed (missing [tickets])

    User->>SimApp: Initiate HubSpot OAuth
    SimApp->>HubSpot: Authorization request with scopes
    Note over SimApp,HubSpot: After fix: includes crm.objects.tickets.write, tickets, oauth
    HubSpot-->>SimApp: ✅ Authorization code
    SimApp->>HubSpot: Exchange code for token
    HubSpot-->>SimApp: Access token + refresh token
    SimApp-->>User: Connected successfully
Loading

Last reviewed commit: "fix(hubspot): add mi..."

@waleedlatif1 waleedlatif1 merged commit 8b24569 into staging Mar 18, 2026
6 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/oauth branch March 18, 2026 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant