Problem
There are two authentication middlewares with overlapping responsibility (src/middleware/auth.ts and src/middleware/authenticate.ts). Some routes use one, others use the other, increasing the risk of inconsistent enforcement (JWT verification, session expiry, user isActive checks, etc.).
Acceptance criteria
export async function requireAuth(
export class AuthMiddleware {
static validateJwt = async (
Priority
P0 / Critical
Problem
There are two authentication middlewares with overlapping responsibility (
src/middleware/auth.tsandsrc/middleware/authenticate.ts). Some routes use one, others use the other, increasing the risk of inconsistent enforcement (JWT verification, session expiry, user isActive checks, etc.).Acceptance criteria
export async function requireAuth(
export class AuthMiddleware {
static validateJwt = async (
Priority
P0 / Critical