23 routes required explicit @requireAuth decorators. Any new route added without it would silently be unauthenticated. Middleware makes the secure path the default — routes must opt out, not opt in.
Decorators + a custom ESLint rule to catch missing ones. Rejected — linter rules are bypassable, don't run at runtime, and fail open (the route is accessible if the linter isn't run).
middleware/auth.ts +47 −0
Any route that should be publicly accessible (/health, /docs, /auth/login) must be listed explicitly. I chose an allowlist over a denylist because a denylist fails open — forgetting to deny a route is a security gap. Forgetting to allow a route just returns 401, which is recoverable.
Route-level @public decorator for each public route. Same coverage, but requires touching each route file and is easy to forget on new routes. Rejected in favor of a single config location.
config/routes.ts +12 −0
With middleware in place, per-route decorators are now redundant — auth runs twice if both are present. I removed all 23 instances. Each was verified against the PUBLIC_ROUTES allowlist before removal to ensure no route became unprotected.
The @adminOnly and @roleRequired decorators are not removed — those express authorization (who can use a route), not authentication (whether you're logged in). They're layered on top of auth and remain unchanged.
routes/users.ts (representative)
Replaced the in-memory Map<string, Session> with Redis. In-memory sessions don't survive server restarts and don't work across multiple instances. Redis solves both.
I don't know your Redis deployment setup. If Redis is unavailable at startup, the server will throw and fail to boot. If Redis goes down in production, all active sessions fail silently — users are logged out. I don't know if either of these is acceptable, and I can't determine it from the codebase.
Is the Redis change intentional? Did all 23 decorator removals check out? Is there anything in
server.ts worth worrying about?Switch to "With Brief" to see the same PR with the agent's reasoning.