Fix Console device sign-in opening a doubled /console URL - #2
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 openedconsole.opencode.ai/console/...and then 302ed to the doubledopencode.ai/console/console/deviceroute.The public Console site is
https://opencode.ai/console. Theconsole.opencode.aihost 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.aidevice pages ontoopencode.ai/console. That host was this provider's documented default, andOPENCODE_CONSOLE_SERVERmay still point at it.verification_uri_completewith the URL constructor instead of string concatenationhttps://opencode.ai/consoleconsole.opencode.aidevice pages ontohttps://opencode.ai/console/device/opencode-console statusVerification
npm run checknpm run packagePOST https://console.opencode.ai/auth/device/codeandPOST https://opencode.ai/console/auth/device/codeboth returnverification_uri_complete: "/console/device?user_code=..."https://console.opencode.ai/console/device302s tohttps://opencode.ai/console/console/devicehttps://opencode.ai/console/devicereturns 200Checklist
npm run check.npm run package.