fix(salesforce): updated to more flexible oauth that allows production, developer, and custom domain salesforce orgs (#2441)#2444
Merged
waleedlatif1 merged 4 commits intostagingfrom Dec 18, 2025
Conversation
…eading to duplicate oauth records (#2441) * fix(oauth): updated oauth providers that had unstable reference IDs leading to duplicate oauth records * ack PR comments
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
Greptile SummaryThis PR modernizes Salesforce OAuth to support Production, Sandbox (Developer Edition), and Custom Domain (My Domain) organizations through a flexible multi-endpoint authentication flow. Key Changes:
Previous Thread Resolutions:
Unrelated Change: Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Browser
participant AuthRoute as Salesforce Authorize
participant SF as Salesforce
participant Callback as Callback Handler
participant DB
User->>Browser: Click Connect Salesforce
Browser->>AuthRoute: Request without orgType
AuthRoute->>Browser: HTML form with org options
Browser->>User: Show form
User->>Browser: Select Production/Sandbox/Custom
Browser->>AuthRoute: Request with orgType
AuthRoute->>AuthRoute: Validate custom domain
AuthRoute->>AuthRoute: Generate PKCE
AuthRoute->>Browser: Set secure cookies
Browser->>SF: OAuth authorization
SF->>User: Login prompt
User->>SF: Authenticate
SF->>Callback: Return auth code
Callback->>Callback: Verify state and PKCE
Callback->>SF: Exchange code for token
SF->>Callback: Access token and instanceUrl
Callback->>Callback: Build metadata JSON
Callback->>DB: Save or update account
Callback->>Browser: Redirect to app
Note over DB: Token Refresh Later
DB->>SF: Refresh with authBaseUrl
alt Primary endpoint works
SF->>DB: New token
else Try production fallback
SF->>DB: New token
else Try sandbox fallback
SF->>DB: New token
end
|
Collaborator
Author
|
@greptile |
Collaborator
Author
|
@greptile |
waleedlatif1
added a commit
that referenced
this pull request
Dec 18, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Type of Change
Testing
Tested manually
Checklist