mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-03 04:50:52 +08:00
feat (auth): CLI OAuth supports pasting callback URLs to complete login
- Added callback URL resolution and terminal prompt logic - Codex/Claude/iFlow/Antigravity/Gemini login supports callback URL or local callback completion - Update Gemini login option signature and manager call - CLI default prompt function is compatible with null input to continue waiting
This commit is contained in:
@@ -99,9 +99,18 @@ func (AntigravityAuthenticator) Login(ctx context.Context, cfg *config.Config, o
|
||||
fmt.Println("Waiting for antigravity authentication callback...")
|
||||
|
||||
var cbRes callbackResult
|
||||
manualCh, manualErrCh := promptForOAuthCallback(opts.Prompt, "antigravity")
|
||||
select {
|
||||
case res := <-cbChan:
|
||||
cbRes = res
|
||||
case manual := <-manualCh:
|
||||
cbRes = callbackResult{
|
||||
Code: manual.Code,
|
||||
State: manual.State,
|
||||
Error: manual.Error,
|
||||
}
|
||||
case err = <-manualErrCh:
|
||||
return nil, err
|
||||
case <-time.After(5 * time.Minute):
|
||||
return nil, fmt.Errorf("antigravity: authentication timed out")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user