fix(monday): support OAuth 2.1 - #7384
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThe PR updates Monday authentication to support its production OAuth 2.1 flow.
Confidence Score: 5/5The PR appears safe to merge, with no concrete changed-code defect established. The reviewed enrollment, token exchange, refresh rotation, expiry derivation, legacy compatibility, and bounded-response paths are internally consistent, and no reachable blocking failure remains.
|
| Filename | Overview |
|---|---|
| apps/sim/lib/oauth/monday.ts | Adds a bounded, PKCE-aware Monday authorization-code exchange and JWT-based access-token expiry resolution. |
| apps/sim/lib/oauth/oauth.ts | Moves Monday refreshes to the OAuth 2.1 endpoint, JSON credentials, rotation enforcement, and JWT-derived expiry. |
| apps/sim/lib/auth/connectors/providers.ts | Enables PKCE for the ordinary Monday connector, installs the custom exchange, and hardens user-info parsing. |
| apps/sim/lib/auth/connectors/managed-oauth.ts | Requires PKCE and refresh-token persistence for newly enrolled managed Monday credentials. |
| apps/sim/lib/oauth/monday.test.ts | Covers the new exchange body, expiry precedence, malformed responses, secret-safe errors, and response limits. |
Sequence Diagram
sequenceDiagram
participant U as User
participant S as Sim OAuth callback
participant M as Monday OAuth
participant D as Credential store
U->>S: Start Monday authorization
S->>M: Authorization request with PKCE challenge
M-->>S: Authorization code
S->>M: Exchange code, verifier, and callback URI
M-->>S: Access token, rotated refresh token, scopes
S->>D: Persist tokens and derived expiry
D-->>S: Expiring credential
S->>M: Refresh using JSON client credentials
M-->>S: New access and refresh tokens
S->>D: Persist rotated refresh token and expiry
Reviews (1): Last reviewed commit: "fix(monday): support OAuth 2.1" | Re-trigger Greptile
There was a problem hiding this comment.
All reported issues were addressed across 9 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
|
@cubic-dev-ai review this PR |
@BillLeoutsakosvl346 I have started the AI code review. It will take a few minutes to complete. |
Summary
Fix Monday account connections for the OAuth 2.1 flow used by the production Monday app.
The observed production failure occurs at authorization with invalid_scope because the live Monday app version does not accept the seven scopes Sim requests. The connector was also still configured for the legacy Monday flow: PKCE was disabled, code exchange and refresh used the legacy token endpoint, and refresh-token rotation and JWT access-token expiry were not handled. Updating only the Monday app settings would therefore expose later callback and refresh failures.
This PR:
Production report: https://sim-ai.slack.com/archives/C093DF8MA21/p1788311390749429
Type of Change
Testing
Passed locally:
Review focus:
Required Monday rollout configuration
Before production rollout, configure the matching Monday app version in Monday Developer Center:
Users whose authorization already failed must start the connection again after the app version is published. Existing credentials are intentionally not migrated in this PR.
Checklist
Screenshots/Videos
Not applicable; this change has no UI modifications.