The auth middleware runs on Node.js runtime, adding latency to every protected route. Moving to Edge Runtime reduces cold start time and improves global latency.\n\nAdd export const runtime = 'edge' to middleware.ts. Replace any Node.js-only APIs with Edge-compatible alternatives. Ensure JWT verification uses jose (Web Crypto API compatible).\n\nAcceptance Criteria: Vercel deployment shows middleware running on Edge Runtime.\n\nFiles: middleware.ts (Modify — add runtime export)
The auth middleware runs on Node.js runtime, adding latency to every protected route. Moving to Edge Runtime reduces cold start time and improves global latency.\n\nAdd export const runtime = 'edge' to middleware.ts. Replace any Node.js-only APIs with Edge-compatible alternatives. Ensure JWT verification uses jose (Web Crypto API compatible).\n\nAcceptance Criteria: Vercel deployment shows middleware running on Edge Runtime.\n\nFiles: middleware.ts (Modify — add runtime export)