feat: Add chromedp and rod-based OAuth authorization methods.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user