Fix Console device sign-in opening a doubled /console URL - #41
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.
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.
Merged
5 tasks done
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://opencode.ai/consoleor theconsole.opencode.aialias), which openedconsole.opencode.ai/console/...and the doubledopencode.ai/console/console/...route.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.verification_uri_completewith the URL constructor instead of string concatenationconsole.opencode.aidevice pages ontohttps://opencode.ai/console/deviceVerification
npm testnpm run packagePOST https://opencode.ai/console/auth/device/codereturnsverification_uri_complete: "/console/device?user_code=..."https://console.opencode.ai/console/device302s tohttps://opencode.ai/console/console/deviceChecklist
npm test.npm run package.