Skip to content

Prefer verification_uri_complete for Copilot login#739

Merged
steipete merged 2 commits intosteipete:mainfrom
skhe:fix/copilot-verification-uri-complete
Apr 18, 2026
Merged

Prefer verification_uri_complete for Copilot login#739
steipete merged 2 commits intosteipete:mainfrom
skhe:fix/copilot-verification-uri-complete

Conversation

@skhe
Copy link
Copy Markdown
Contributor

@skhe skhe commented Apr 18, 2026

Fixes #738

This updates the Copilot device login flow to prefer verification_uri_complete over verification_uri when opening the browser.

Why:

  • GitHub device flow can return a complete verification URL that already carries the user code
  • CodexBar currently ignores that field and always opens the bare verification page
  • In practice, this can make the Copilot login flow confusing because the user code is not reliably visible in the browser flow

Changes:

  • Decode verification_uri_complete in CopilotDeviceFlow.DeviceCodeResponse
  • Add a small verificationURLToOpen helper with fallback to verification_uri
  • Use that helper in CopilotLoginFlow
  • Add tests for both the preferred and fallback paths

Verification:

  • swift build
  • swift test --filter CopilotDeviceFlowTests

Notes:

  • pnpm check could not complete in my environment because the lint script attempted to download SwiftFormat and failed before running the checks.

@steipete steipete force-pushed the fix/copilot-verification-uri-complete branch from 010254d to ef86cda Compare April 18, 2026 20:39
@steipete steipete merged commit d968dd9 into steipete:main Apr 18, 2026
1 check passed
@steipete
Copy link
Copy Markdown
Owner

Landed via temp rebase onto main.

  • Gate: swiftformat Sources Tests; swiftlint --strict; pnpm check; swift build; swift test -q; ./Scripts/compile_and_run.sh
  • Land commit: ef86cda
  • Merge commit: d968dd9

Thanks @skhe!

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.

Copilot login opens the bare device-flow URL instead of verification_uri_complete

2 participants