fix(ui): drop redundant /ui/ prefix from login/consent route paths#158
Merged
fix(ui): drop redundant /ui/ prefix from login/consent route paths#158
Conversation
fastify-autoload's `dirNameRoutePrefix: true` (default) derives the
prefix from the directory name — so `routes/ui/login.ts` declaring
`.get('/ui/login', ...)` registered the route at `/ui/ui/login` and
`GET /ui/login` returned 404. Same for `/ui/consent`.
Aligns with the pattern already used by `routes/oauth/authorize.ts`,
which declares `'/authorize'` and is reachable at `/oauth/authorize`.
Integration-side paths (HTML form `action=`, redirects, smoke test,
OIDC discovery links) are unchanged — they stay as `/ui/login` and
`/ui/consent`, which is now what the routes actually register as.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
View your CI Pipeline Execution ↗ for commit 6bad1a4
☁️ Nx Cloud last updated this comment at |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GET /ui/loginwas returning 404 in production because the route was actually registered at/ui/ui/loginroutes/ui/login.tsdeclared.get('/ui/login', ...)but fastify-autoload adds the directory name as a route prefix by default (dirNameRoutePrefix: true), so the/ui/part got duplicatedroutes/ui/consent.ts'/login'and'/consent'inside the handlers; autoload's directory prefix produces the final/ui/loginand/ui/consentpaths that every caller expects (HTML formaction=, redirect targets, OIDC discovery, smoke test)Matches the existing pattern in
routes/oauth/authorize.tswhich declares'/authorize'and is reachable at/oauth/authorize.Test plan
curl https://qauth.naqshi.net/ui/loginreturns 200 (currently 404)curl https://qauth.naqshi.net/ui/consent?...returns the consent page (currently 404)GET /oauth/authorizestill redirects to/ui/login?return_to=...and that redirect resolves (currently dead-ends at 404)🤖 Generated with Claude Code