Repository navigation
fix: CLI-style auth — open URL, then paste Studio key - #8
Merged
Merged
Conversation
Match `cmd login`: OAuth uses method "code" so OpenCode prompts for the key Studio shows after Authorize (or "ok" if localhost callback already succeeded). Remove the standalone "Enter API key" method. Harden the localhost callback CORS for Chrome Private Network Access. Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com>
sdziupin
marked this pull request as ready for review
August 9, 2026 06:09
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.
Problem
cmd loginflow: after Authorize, Studio shows a one-time key to paste into the terminal.Fix
method: "code"(same pattern as Claude plugin): show Studio URL, then prompt to paste the key (orokif the localhost callback already succeeded).cmd login) and harden CORS for Chrome Private Network Access (Access-Control-Allow-Private-Network) so automatic transfer can still succeed when the browser can reach the callback./alpha/whoami.Notes on the 403
Studio’s error page (
/studio/auth/cli/error) is shown when the Authorize action itself fails (not when the localhost callback returns 403 — that path shows the Copy your API key fallback). Callback CORS was still tightened because a rejected localhost POST previously leftmethod: "auto"waiting forever with no paste prompt.Test plan
npm run buildnpm test(smoke includes PNA preflight, Studio POST → pasteok, and asserts no standalone API-key method)opencode auth login --provider command-code→ Login with Command Code → Authorize → paste key