Skip to content

Use configured backend for OAuth callbacks - #2822

Merged
nezaj merged 2 commits into
mainfrom
fix/self-host-oauth-callbacks
Aug 3, 2026
Merged

Use configured backend for OAuth callbacks#2822
nezaj merged 2 commits into
mainfrom
fix/self-host-oauth-callbacks

Conversation

@nezaj

@nezaj nezaj commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Previously, OAuth setup in the dashboard and CLI always used Instant Cloud’s callback URL.

This change derives the callback from the configured API URL so self-hosted deployments use their own backend!

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 63af76dc-0f7d-4fc8-b5cc-74a43c560b79

📥 Commits

Reviewing files that changed from the base of the PR and between d712ee5 and 4f77d8c.

📒 Files selected for processing (1)
  • client/packages/version/src/version.ts

📝 Walkthrough

Walkthrough

The PR derives OAuth callback URLs from configured API URIs. The CLI uses these URLs across add and update flows. Dashboard OAuth instructions use API-derived fallback URLs. Tests cover URL normalization and propagation.

Changes

OAuth callback configuration

Layer / File(s) Summary
Callback URL contract
client/packages/platform/src/consts.ts, client/packages/platform/src/index.ts, client/packages/cli/src/lib/config.ts, client/www/lib/config.ts
Adds oauthCallbackURL and derives CLI and dashboard callback URLs from configured API URIs.
CLI add flow propagation
client/packages/cli/src/commands/auth/client/add.ts, client/packages/cli/src/commands/auth/client/shared.ts, client/packages/cli/src/lib/oauth.ts
Passes the runtime callback URL through provider handlers, redirect prompts, fallback redirects, and setup messages.
CLI update flow propagation
client/packages/cli/src/commands/auth/client/update.ts
Uses the configured callback URL across Google, GitHub, LinkedIn, and Apple update flows.
Validation and dashboard integration
client/packages/cli/__tests__/*, client/packages/platform/__tests__/src/consts.test.ts, client/www/components/dash/auth/*, client/packages/version/src/version.ts
Adds callback URL coverage, updates dashboard fallback URLs, and increments the shared package version.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CLICommand
  participant CLIConfig
  participant OAuthProviders
  participant RedirectPrompts
  CLICommand->>CLIConfig: Resolve configured callback URL
  CLIConfig-->>CLICommand: Return normalized callback URL
  CLICommand->>OAuthProviders: Pass callback URL to add or update handlers
  OAuthProviders->>RedirectPrompts: Render redirect guidance and setup messages
  RedirectPrompts-->>OAuthProviders: Use configured callback URL
Loading

Possibly related PRs

Suggested reviewers: stopachka

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 7.69% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: using the configured backend for OAuth callback URLs.
Description check ✅ Passed The description directly explains deriving OAuth callbacks from the configured API URL for self-hosted deployments.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/self-host-oauth-callbacks

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@stopachka stopachka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM!

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

View Vercel preview at instant-www-js-fix-self-host-oauth-callbacks-jsv.vercel.app.

@nezaj
nezaj merged commit e7941e3 into main Aug 3, 2026
23 of 24 checks passed
@nezaj
nezaj deleted the fix/self-host-oauth-callbacks branch August 3, 2026 21:19
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.

2 participants