feat(web-gui): generalize OAuth device login for multiple providers#2155
Conversation
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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Review: LGTM ✅ Clean frontend counterpart to #2154 that correctly generalizes the OAuth device login flow.
Non-blocking nits:
Waiting for CI to pass before merge. |
Holon Run Report
|
Summary
Frontend OAuth device login is no longer hardcoded to Codex. The settings page now passes the current
provider.idto the generic/auth/{provider}/device/startendpoint (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/startinstead of hardcoded/auth/codex/device/startruntime-store.ts:startCodexDeviceLoginpassesproviderIdthrough to the clientSettingsPage.tsx: OAuth login button passesprovider.id; addssupportsOAuthDeviceLogin()helper (returns true foropenai-codexandxai)SettingsPage.test.ts: tests forsupportsOAuthDeviceLoginVerification
pnpm exec vitest run— 56 tests passed (2 test files)pnpm exec tsc --noEmit— no new errors (1 pre-existingunistmodule resolution error unrelated to this change)Notes
This is the frontend counterpart to #2154 (backend OAuth generalization). The
supportsOAuthDeviceLoginhelper is exported for future use in auth-mode switching UI (API Key ↔ OAuth toggle), which will be a follow-up.Part of #2153