refactor: single-window IDC auth with JSON API and token selection fixes #1
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
@awsapps.localaccounts from Kiro CLI sync (and stale tokens) could be selected, leading to 403 AccessDeniedException ("bearer token is invalid").auth.loaderreturned an emptyapiKey.What Changed (User-facing)
What Changed (Implementation)
GET /serves a combined page for Start URL + Region + Begin + code + status polling (src/plugin/auth-page.ts).GET /beginreturns JSON{ verificationUrl, verificationUriComplete, userCode, region }and triggers server-side token polling (src/plugin/server.ts)./statusincludesmessagealiasingerror;/error?message=...is parsed and rendered correctly.origin + /startand can follow redirects to canonical*.awsapps.comportal hosts (src/kiro/oauth-idc.ts).src/plugin/config/schema.ts).src/plugin/server.ts).src/plugin/accounts.ts).src/core/auth/auth-handler.ts,src/core/auth/idc-auth-method.ts).src/plugin/sync/kiro-cli.ts).auth.loaderreturnsapiKeyderived from stored auth so OpenCode UI can display connected (src/plugin.ts).maxsupport (src/core/request/thinking.ts,src/core/request/request-handler.ts,README.md).Tests
npm testnpm run typecheckNotable Behavior Changes / Risks
/beginis now JSON (breaking for any consumers relying on it as an HTML navigation endpoint).