Skip to content

feat(web-gui): generalize OAuth device login for multiple providers#2155

Merged
jolestar merged 1 commit into
mainfrom
task-task_f3453ea3ebba8f4
Jul 11, 2026
Merged

feat(web-gui): generalize OAuth device login for multiple providers#2155
jolestar merged 1 commit into
mainfrom
task-task_f3453ea3ebba8f4

Conversation

@jolestar

Copy link
Copy Markdown
Collaborator

Summary

Frontend OAuth device login is no longer hardcoded to Codex. The settings page now passes the current provider.id to the generic /auth/{provider}/device/start endpoint (added in #2154), so xAI and other OAuth-supporting providers can reuse the existing device login flow.

Changes

  • client.ts: startCodexDeviceLogin(providerId) calls /auth/{provider}/device/start instead of hardcoded /auth/codex/device/start
  • runtime-store.ts: startCodexDeviceLogin passes providerId through to the client
  • SettingsPage.tsx: OAuth login button passes provider.id; adds supportsOAuthDeviceLogin() helper (returns true for openai-codex and xai)
  • SettingsPage.test.ts: tests for supportsOAuthDeviceLogin

Verification

  • pnpm exec vitest run — 56 tests passed (2 test files)
  • pnpm exec tsc --noEmit — no new errors (1 pre-existing unist module resolution error unrelated to this change)

Notes

This is the frontend counterpart to #2154 (backend OAuth generalization). The supportsOAuthDeviceLogin helper is exported for future use in auth-mode switching UI (API Key ↔ OAuth toggle), which will be a follow-up.

Part of #2153

Frontend now passes providerId to the OAuth device login API,
allowing xAI and other OAuth-supporting providers to reuse the
existing device login flow alongside openai-codex.

Changes:
- client.ts: startCodexDeviceLogin accepts providerId, calls
  /auth/{provider}/device/start instead of hardcoded /auth/codex/device/start
- runtime-store.ts: startCodexDeviceLogin passes providerId through
- SettingsPage.tsx: OAuth login button passes current provider.id;
  add supportsOAuthDeviceLogin helper for openai-codex and xai
- SettingsPage.test.ts: test for supportsOAuthDeviceLogin

Part of #2153
@vercel

vercel Bot commented Jul 11, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
holon Ready Ready Preview, Comment Jul 11, 2026 1:03am

@jolestar

Copy link
Copy Markdown
Collaborator Author

Review: LGTM

Clean frontend counterpart to #2154 that correctly generalizes the OAuth device login flow.

  1. Provider ID propagation — correctly threads providerId from the UI button through runtime-store to client.ts, with encodeURIComponent for the URL path segment. Default "openai-codex" at both layers preserves backward compatibility.

  2. supportsOAuthDeviceLogin helper — simple allow-list approach is appropriate for the current scope. Exported for future auth-mode switching UI.

  3. Test coverage — positive cases for openai-codex and xai, negative case for openai. Adequate.

  4. Interface changeonStartCodexDeviceLogin signature change to optional providerId is non-breaking.

Non-blocking nits:

  • Same naming concern as feat: generalize OAuth device login for xAI #2154: startCodexDeviceLogin is now a misnomer. A follow-up rename to startDeviceLogin or startOAuthDeviceLogin would be cleaner.
  • Hardcoded provider list in supportsOAuthDeviceLogin could eventually be driven by provider metadata from the backend.

Waiting for CI to pass before merge.

@holonbot holonbot Bot 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.

LGTM ✅ — Clean frontend counterpart to #2154. Provider ID is correctly threaded through all layers with proper encoding and backward-compatible defaults. No blocking findings.

@holonbot

holonbot Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Holon Run Report

@jolestar
jolestar merged commit 35dd1b3 into main Jul 11, 2026
5 checks passed
@jolestar
jolestar deleted the task-task_f3453ea3ebba8f4 branch July 11, 2026 01:13
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