Skip to content

fix(ui): drop redundant /ui/ prefix from login/consent route paths#158

Merged
EsTharian merged 1 commit intomainfrom
fix/ui-route-double-prefix
Apr 24, 2026
Merged

fix(ui): drop redundant /ui/ prefix from login/consent route paths#158
EsTharian merged 1 commit intomainfrom
fix/ui-route-double-prefix

Conversation

@EsTharian
Copy link
Copy Markdown
Member

Summary

  • GET /ui/login was returning 404 in production because the route was actually registered at /ui/ui/login
  • routes/ui/login.ts declared .get('/ui/login', ...) but fastify-autoload adds the directory name as a route prefix by default (dirNameRoutePrefix: true), so the /ui/ part got duplicated
  • Same bug in routes/ui/consent.ts
  • Fix: declare '/login' and '/consent' inside the handlers; autoload's directory prefix produces the final /ui/login and /ui/consent paths that every caller expects (HTML form action=, redirect targets, OIDC discovery, smoke test)

Matches the existing pattern in routes/oauth/authorize.ts which declares '/authorize' and is reachable at /oauth/authorize.

Test plan

  • curl https://qauth.naqshi.net/ui/login returns 200 (currently 404)
  • curl https://qauth.naqshi.net/ui/consent?... returns the consent page (currently 404)
  • GET /oauth/authorize still redirects to /ui/login?return_to=... and that redirect resolves (currently dead-ends at 404)
  • Existing route tests pass unchanged — the test stubs ignore the URL string and capture handlers directly

🤖 Generated with Claude Code

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>
@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Apr 24, 2026

View your CI Pipeline Execution ↗ for commit 6bad1a4

Command Status Duration Result
nx affected -t lint test build ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-04-24 17:48:57 UTC

@EsTharian EsTharian merged commit a456ced into main Apr 24, 2026
3 checks passed
Copy link
Copy Markdown

@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 updates the route paths for the consent and login endpoints in the auth-server by removing the '/ui' prefix from the GET and POST methods. I have no feedback to provide.

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