feat: Add chromedp and rod-based OAuth authorization methods.

This commit is contained in:
2026-02-01 09:19:53 +08:00
parent 76ff32e83c
commit d05c19a8d5
2 changed files with 50 additions and 34 deletions

View File

@@ -123,7 +123,8 @@ func (r *RodAuth) Close() {
func (r *RodAuth) CompleteOAuth(authURL, email, password, teamID string) (string, error) {
// Handle proxy auth (407) in headless mode.
// When Fetch domain is enabled without patterns, requests will be paused and must be continued.
if r.proxy != "" {
// 只在代理需要认证时才启用 Fetch 域
if r.proxy != "" && r.proxyUser != "" {
authBrowser, cancel := r.browser.WithCancel()
defer cancel()
@@ -160,7 +161,8 @@ func (r *RodAuth) CompleteOAuth(authURL, email, password, teamID string) (string
}
defer page.Close()
page = page.Timeout(45 * time.Second)
// 增加超时时间到 90 秒
page = page.Timeout(90 * time.Second)
if err := page.Navigate(authURL); err != nil {
return "", fmt.Errorf("访问授权URL失败: %v", err)