mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-13 08:15:17 +00:00
fix(kiro): prefer scored URL extraction for stderr manual callback
Use extractLikelyOAuthAuthorizationUrl before falling back to naive regex when detecting auth URLs in stderr for manual callback replay. Prevents prompting with non-OAuth URLs when stderr emits multiple URLs.
This commit is contained in:
1 parent
d95cee1e84
commit
5b1754a320
1 file changed
+4
-3
@@ -765,13 +765,14 @@ export function executeOAuthProcess(options: OAuthProcessOptions): Promise<Accou
|
|||||||
displayUrlFromStderr(output, state, oauthConfig);
|
displayUrlFromStderr(output, state, oauthConfig);
|
||||||
}
|
}
|
||||||
if (options.manualCallback && !state.manualCallbackPrompted) {
|
if (options.manualCallback && !state.manualCallbackPrompted) {
|
||||||
const urlMatch = output.match(/https?:\/\/[^\s]+/);
|
const authUrl =
|
||||||
if (urlMatch) {
|
extractLikelyOAuthAuthorizationUrl(output) ?? output.match(/https?:\/\/[^\s]+/)?.[0];
|
||||||
|
if (authUrl) {
|
||||||
state.manualCallbackPrompted = true;
|
state.manualCallbackPrompted = true;
|
||||||
await replayManualCallback(
|
await replayManualCallback(
|
||||||
options.oauthConfig,
|
options.oauthConfig,
|
||||||
authProcess,
|
authProcess,
|
||||||
urlMatch[0],
|
authUrl,
|
||||||
options.verbose,
|
options.verbose,
|
||||||
state,
|
state,
|
||||||
10 * 60 * 1000
|
10 * 60 * 1000
|
||||||
|
|||||||
Reference in new issue
Block a user