refactor(auth): replace manual input handling with AsyncPrompt for callback URLs

This commit is contained in:
hkfires
2026-03-20 12:24:27 +08:00
parent cccb77b552
commit 636da4c932
6 changed files with 22 additions and 60 deletions

View File

@@ -155,18 +155,7 @@ waitForCallback:
return nil, err
default:
}
inputCh := make(chan string, 1)
inputErrCh := make(chan error, 1)
go func() {
input, errPrompt := opts.Prompt("Paste the Codex callback URL (or press Enter to keep waiting): ")
if errPrompt != nil {
inputErrCh <- errPrompt
return
}
inputCh <- input
}()
manualInputCh = inputCh
manualInputErrCh = inputErrCh
manualInputCh, manualInputErrCh = misc.AsyncPrompt(opts.Prompt, "Paste the Codex callback URL (or press Enter to keep waiting): ")
continue
case input := <-manualInputCh:
manualInputCh = nil