Skip to content

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

Merged
grikomsn merged 2 commits into
mainfrom
fix/console-device-verification-url
Sep 9, 2026
Merged

grikomsn merged 2 commits into
mainfrom
fix/console-device-verification-url

Conversation

@grikomsn

@grikomsn grikomsn commented Sep 9, 2026

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://opencode.ai/console or the console.opencode.ai alias), which opened console.opencode.ai/console/... and the doubled opencode.ai/console/console/... 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.

  • Resolve verification_uri_complete with the URL constructor instead of string concatenation
  • Canonicalize console.opencode.ai device pages onto https://opencode.ai/console/device
  • Keep the API server used for token polling unchanged

Verification

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

Checklist

  • The change is focused and contains no unrelated churn.
  • Tests pass with npm test.
  • 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 9, 2026
Sign-in always uses the /console subpath on opencode.ai. Resolving
verification_uri_complete against that base is enough; the host alias
is not on the runtime path.
@grikomsn
grikomsn merged commit 1c8ad84 into main Sep 9, 2026
3 checks passed
@grikomsn
grikomsn deleted the fix/console-device-verification-url branch September 9, 2026 10:28
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