Skip to content

fix(cli): resolve blank device code and undefined verification URL in oauth start (#11164) - #11173

Merged
diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.50from
rqzbeh:fix/oauth-device-code-undefined-11164
Aug 22, 2026
Merged

diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.50from
rqzbeh:fix/oauth-device-code-undefined-11164

Conversation

@rqzbeh

@rqzbeh rqzbeh commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Resolves #11164 where omniroute oauth start --provider claude-code --no-browser (and other device-flow CLI OAuth commands) printed a blank device code and Visit: undefined:

  1. Endpoint Resolution:
    Updated runDeviceFlow in bin/cli/commands/oauth.mjs to try /api/oauth/${providerKey}/device-code before falling back to /api/providers/${providerKey}/auth/start.

  2. Property Normalization:
    Extracted property fallbacks for both camelCase and snake_case response payloads:

    • userCode: start.userCode ?? start.user_code ?? ""
    • verificationUri: start.verificationUriComplete ?? start.verification_uri_complete ?? start.verificationUri ?? start.verification_uri ?? start.authUrl ?? start.url ?? ""
  3. Output Formatting:
    Surfaces Device code: ... only when a user code is present; avoids printing undefined URLs or empty labels.

Verification

  • node --import tsx/esm --test tests/unit/oauth-device-flow-11164.test.ts (PASS)
  • npm run typecheck:core (0 errors)
  • npm run check:docs-all (PASS)

@rqzbeh
rqzbeh requested a review from diegosouzapw as a code owner August 22, 2026 22:43
@diegosouzapw
diegosouzapw force-pushed the fix/oauth-device-code-undefined-11164 branch from 7c88f7c to 1d10740 Compare August 22, 2026 23:13
@diegosouzapw
diegosouzapw merged commit ec6010f into diegosouzapw:release/v3.8.50 Aug 22, 2026
5 of 7 checks passed
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
… oauth start (diegosouzapw#11164) (diegosouzapw#11173)

Cherry-picked onto the current tip (authorship preserved), noise stripped. Focused: oauth-device-flow-11164 green + 9474-claude-code-oauth-mismap neighbor suite green. Device-code endpoint is tried first, camelCase/snake_case fallbacks normalized, no more blank code / 'Visit: undefined'. Fixes diegosouzapw#11164. Thank you @rqzbeh!
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.

oauth start --provider claude-code returns blank device code / Visit: undefined

2 participants