Skip to content

Add alternativeWebUrl param#956

Open
ibdafna wants to merge 3 commits into
coder:mainfrom
ibdafna:nflx/support-alternative-web-url
Open

Add alternativeWebUrl param#956
ibdafna wants to merge 3 commits into
coder:mainfrom
ibdafna:nflx/support-alternative-web-url

Conversation

@ibdafna
Copy link
Copy Markdown

@ibdafna ibdafna commented May 15, 2026

This PR adds a new parameter for specifying an alternative URL to use when opening Coder pages in the browser. When set, it replaces the connection URL for browser links only (dashboard, workspace pages, token authentication page). The connection URL is still used for API calls, SSH, and CLI operations. Useful when the Coder API runs on a port that browsers restrict (e.g., 7004) but the web UI is accessible on a standard port (e.g., 443)."

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e9e8beed19

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/webviews/chat/chatPanelProvider.ts Outdated
Comment thread src/login/loginCoordinator.ts Outdated
@EhabY EhabY self-assigned this May 17, 2026
Copy link
Copy Markdown
Collaborator

@EhabY EhabY left a comment

Choose a reason for hiding this comment

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

Nice improvement. Make sure to run pnpm format and pnpm lint:fix/pnpm typecheck!

Comment thread src/util.ts Outdated
Comment thread src/oauth/authorizer.ts Outdated
Comment thread src/webviews/chat/chatPanelProvider.ts Outdated
Comment thread src/webviews/tasks/tasksPanelProvider.ts Outdated
Comment thread test/unit/webviews/chat/chatPanelProvider.test.ts Outdated
Comment thread package.json Outdated
Comment thread src/oauth/authorizer.ts
@ibdafna ibdafna force-pushed the nflx/support-alternative-web-url branch from 5f34410 to fc18726 Compare May 28, 2026 20:37
Comment thread src/oauth/authorizer.ts
Comment on lines +228 to +229
const prefix = browserBase.pathname.replace(/\/$/, "");
endpoint.pathname = `${prefix}${endpoint.pathname}`;
Copy link
Copy Markdown
Collaborator

@EhabY EhabY Jun 2, 2026

Choose a reason for hiding this comment

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

This doubles the path prefix on sub-path deployments. If the connection URL has a path (e.g. https://example.com/coder), the server already returns authorization_endpoint with that prefix, so prepending browserBase.pathname yields /coder/coder/oauth2/authorize.

This is a regression: OAuth breaks on sub-path deployments even when alternativeWebUrl is unset. Stripping the connection prefix from the endpoint path before applying the UI prefix would fix it.

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.

2 participants