Skip to content

Carry request path through 404 page links for smoother OAuth redirects#166

Open
oosawy wants to merge 3 commits intovercel-labs:mainfrom
oosawy:feat/preserve-404-path
Open

Carry request path through 404 page links for smoother OAuth redirects#166
oosawy wants to merge 3 commits intovercel-labs:mainfrom
oosawy:feat/preserve-404-path

Conversation

@oosawy
Copy link
Copy Markdown

@oosawy oosawy commented Mar 28, 2026

As mentioned in the google-oauth example, using plain localhost as the OAuth redirect URI means you lose the portless benefits for the callback flow. But the callback does land on portless's 404 page, which already lists active apps — you can manually click through to the right one. The only thing missing is that the path and query string get dropped along the way.

Changes

  • Append req.url to the active-app links on the 404 page so the full path and query string carry over
  • For OAuth callbacks this means one click instead of manually reconstructing the URL
  • Root-path requests (/) produce clean links with no trailing slash

Test plan

  • pnpm test — 3 new test cases (path preserved, path + query preserved, root path omitted)
  • Existing proxy tests pass without changes

If desired, we could also surface an extra hint on the 404 page when the request has a non-root path, but kept it minimal for now.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 28, 2026

@oosawy-ab is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

@oosawy oosawy force-pushed the feat/preserve-404-path branch from 77a28f1 to 6b62cc5 Compare March 28, 2026 02:05
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