mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-14 04:15:52 +00:00
fix(cliproxy): preserve kiro paste-callback start route
This commit is contained in:
1 parent
fa027022a8
commit
86ca18003a
3 files changed
+33
-11
No files matched your search
@@ -37,7 +37,7 @@ import {
|
||||
getOAuthConfig,
|
||||
ProviderOAuthConfig,
|
||||
CLIPROXY_CALLBACK_PROVIDER_MAP,
|
||||
getManagementAuthUrlPath,
|
||||
getPasteCallbackStartPath,
|
||||
getManagementOAuthCallbackPath,
|
||||
normalizeKiroAuthMethod,
|
||||
} from './auth-types';
|
||||
@@ -276,10 +276,16 @@ async function handlePasteCallbackMode(
|
||||
console.log(info(`Starting ${oauthConfig.displayName} OAuth (paste-callback mode)...`));
|
||||
|
||||
try {
|
||||
// Request auth URL from CLIProxyAPI
|
||||
// Use management auth-url endpoint to match CLIProxyAPI route contract.
|
||||
const startResponse = await fetch(buildProxyUrl(target, getManagementAuthUrlPath(provider)), {
|
||||
headers: buildManagementHeaders(target),
|
||||
// Request auth URL from CLIProxyAPI.
|
||||
// Kiro keeps its legacy start route because CLI auth methods do not share the generic
|
||||
// management auth-url contract used by providers like Claude.
|
||||
const startPath = getPasteCallbackStartPath(provider);
|
||||
const startResponse = await fetch(buildProxyUrl(target, startPath), {
|
||||
...(provider === 'kiro' ? { method: 'POST' } : {}),
|
||||
headers:
|
||||
provider === 'kiro'
|
||||
? buildManagementHeaders(target, { 'Content-Type': 'application/json' })
|
||||
: buildManagementHeaders(target),
|
||||
});
|
||||
|
||||
if (!startResponse.ok) {
|
||||
|
||||
Reference in new issue
Block a user