Skip to content

Fix Console device sign-in opening a doubled /console URL - #2

Merged
grikomsn merged 1 commit into
mainfrom
fix/console-device-verification-url
Sep 14, 2026
Merged

grikomsn merged 1 commit into
mainfrom
fix/console-device-verification-url

Conversation

@grikomsn

Copy link
Copy Markdown
Owner

Summary

Console device authorization returns an origin-absolute verification path (/console/device?user_code=...). Sign-in concatenated that onto the Console API base (https://console.opencode.ai), which opened console.opencode.ai/console/... and then 302ed to the doubled opencode.ai/console/console/device route.

The public Console site is https://opencode.ai/console. The console.opencode.ai host 302-prefixes /console, so it is not a safe browser origin for that path.

Parity with opencode-copilot-chat#41, with one extra this repo still needs: rewrite console.opencode.ai device pages onto opencode.ai/console. That host was this provider's documented default, and OPENCODE_CONSOLE_SERVER may still point at it.

  • Resolve verification_uri_complete with the URL constructor instead of string concatenation
  • Default the API server to https://opencode.ai/console
  • Canonicalize console.opencode.ai device pages onto https://opencode.ai/console/device
  • Keep the API server used for token polling unchanged
  • Treat both public hosts as non-custom in /opencode-console status

Verification

  • npm run check
  • npm run package
  • Live POST https://console.opencode.ai/auth/device/code and POST https://opencode.ai/console/auth/device/code both return verification_uri_complete: "/console/device?user_code=..."
  • https://console.opencode.ai/console/device 302s to https://opencode.ai/console/console/device
  • https://opencode.ai/console/device returns 200

Checklist

  • The change is focused and contains no unrelated churn.
  • Tests pass with npm run check.
  • Packaging passes with npm run package.
  • User-visible changes include a Changeset; otherwise, this is not applicable.
  • Relevant documentation is updated; otherwise, this is not applicable.

Device authorization returns an origin-absolute /console/device path.
String-concatenating that onto the Console API base produced
console.opencode.ai/console/... (and /console/console on opencode.ai).
Resolve the verification URL properly and open opencode.ai/console/device.
@grikomsn grikomsn self-assigned this Sep 14, 2026
@grikomsn
grikomsn merged commit f06f76b into main Sep 14, 2026
3 checks passed
@grikomsn
grikomsn deleted the fix/console-device-verification-url branch September 14, 2026 07:11
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