Skip to content

feat: add OAuth proxy controls to Web UI#246

Open
StarsWhere wants to merge 3 commits intorouter-for-me:mainfrom
StarsWhere:feat/oauth-proxy-controls
Open

feat: add OAuth proxy controls to Web UI#246
StarsWhere wants to merge 3 commits intorouter-for-me:mainfrom
StarsWhere:feat/oauth-proxy-controls

Conversation

@StarsWhere
Copy link
Copy Markdown

Summary

Adds OAuth proxy controls to the Web UI so users can provide a one-time proxy for OAuth login and optionally fill that field from the current global proxy.

Closes #245

Key changes

  • Adds a shared OAuth proxy URL input at the top of the OAuth page.
  • Sends explicit OAuth proxy values as proxy_url when starting OAuth login.
  • Adds a global proxy fill action that copies the configured global proxy into the one-time OAuth proxy field.
  • Keeps the OAuth proxy input in memory only and avoids localStorage persistence.
  • Adds localized text for zh-CN, zh-TW, en, and ru.

Testing

  • Locale JSON parse check
  • npm run lint
  • npm run build

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the ability to configure a proxy for OAuth logins, allowing users to specify a proxy URL or use the global proxy settings for server-side operations. Changes include new UI components on the OAuth page, updated localization files, and modifications to the OAuth API service to handle the proxy parameter. A suggestion was made to simplify the logic for passing authentication options by using shorthand property names and removing redundant undefined checks.

Comment thread src/pages/OAuthPage.tsx
Comment on lines +265 to +269
provider === 'gemini-cli'
? { projectId: projectId || undefined, proxyUrl }
: proxyUrl
? { proxyUrl }
: undefined
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The logic for constructing the options object can be simplified using shorthand property names. Additionally, projectId || undefined is redundant because projectId is already defined as string | undefined and is guaranteed not to be an empty string at this point based on the logic at lines 242-246.

Suggested change
provider === 'gemini-cli'
? { projectId: projectId || undefined, proxyUrl }
: proxyUrl
? { proxyUrl }
: undefined
provider === 'gemini-cli'
? { projectId, proxyUrl }
: proxyUrl
? { proxyUrl }
: undefined

@StarsWhere
Copy link
Copy Markdown
Author

Follow-up pushed in aa242e5 addressing the review suggestion by simplifying the Gemini OAuth options construction.\n\nTesting:\n- npm run lint\n- npm run build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add OAuth proxy controls and global proxy fill action

1 participant