refactor(auth): replace manual input handling with AsyncPrompt for callback URLs
This commit is contained in:
+1
-12
@@ -118,18 +118,7 @@ waitForCallback:
|
||||
break waitForCallback
|
||||
default:
|
||||
}
|
||||
inputCh := make(chan string, 1)
|
||||
inputErrCh := make(chan error, 1)
|
||||
go func() {
|
||||
input, errPrompt := opts.Prompt("Paste the antigravity 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 antigravity callback URL (or press Enter to keep waiting): ")
|
||||
continue
|
||||
case input := <-manualInputCh:
|
||||
manualInputCh = nil
|
||||
|
||||
+1
-12
@@ -152,18 +152,7 @@ waitForCallback:
|
||||
return nil, err
|
||||
default:
|
||||
}
|
||||
inputCh := make(chan string, 1)
|
||||
inputErrCh := make(chan error, 1)
|
||||
go func() {
|
||||
input, errPrompt := opts.Prompt("Paste the Claude 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 Claude callback URL (or press Enter to keep waiting): ")
|
||||
continue
|
||||
case input := <-manualInputCh:
|
||||
manualInputCh = nil
|
||||
|
||||
+1
-12
@@ -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
|
||||
|
||||
+1
-12
@@ -131,18 +131,7 @@ waitForCallback:
|
||||
return nil, fmt.Errorf("iflow auth: callback wait failed: %w", err)
|
||||
default:
|
||||
}
|
||||
inputCh := make(chan string, 1)
|
||||
inputErrCh := make(chan error, 1)
|
||||
go func() {
|
||||
input, errPrompt := opts.Prompt("Paste the iFlow 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 iFlow callback URL (or press Enter to keep waiting): ")
|
||||
continue
|
||||
case input := <-manualInputCh:
|
||||
manualInputCh = nil
|
||||
|
||||
Reference in New Issue
Block a user