Skip to content

fix(oauth): keep OAuth endpoints and requests on the deployment origin - #1177

Open
EhabY wants to merge 1 commit into
fix/origin-keyed-storesfrom
fix/oauth-origin
Open

EhabY wants to merge 1 commit into
fix/origin-keyed-storesfrom
fix/oauth-origin

Conversation

@EhabY

@EhabY EhabY commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

Keeps OAuth endpoints, requests, and error text on the deployment's own origin.

  • Metadata: endpoints off the deployment origin or under a workspace app path (/@user/...) are rejected, and the error does not echo them.
  • Redirects: OAuth POSTs send maxRedirects: 0, so they are never resent to another URL.
  • Error text: OAuth failures show in a modal's plain detail instead of a notification, which renders [text](command:...) links in server text.
  • Pending flow: a superseded or disposed flow cleans up its timer and listeners, and the browser opens without blocking, so a rejection while it opens reaches the caller. The expected state is no longer logged.
  • coder.alternativeWebUrl: ignored unless it is an http(s) URL.

Not in this PR: OAuth requests still carry the session token (revocation relies on it), and the dialog can start a second flow after another window's login wins.

Stacked on #1176; review that first.

- Reject OAuth metadata endpoints off the deployment origin or under a
  workspace app path, without echoing them.
- Send OAuth POSTs with maxRedirects: 0.
- Show OAuth failures in a modal's plain detail, not a notification that
  renders command links.
- Clean up superseded or disposed flows, and open the browser without
  awaiting it so early rejections reach the caller.
- Ignore a coder.alternativeWebUrl that is not http(s).
@EhabY
EhabY requested a review from code-asher October 30, 2026 21:52
@EhabY
EhabY added this pull request to stack #1178 October 30, 2026 21:53

This branch has not been deployed

No deployments
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.

1 participant