Every app/api route handler now goes through withRouteLogging, which logs a correlated reqId/method/path/status/duration for each request and turns any uncaught error into a logged stack trace plus a clean JSON 500 instead of Next's default opaque failure. proxy.ts logs rejected auth attempts, and instrumentation.ts's onRequestError catches anything that still escapes a route handler. Also adds a minimal not-found page matching the app's card styling. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
10 lines
342 B
TypeScript
10 lines
342 B
TypeScript
import { NextResponse } from "next/server";
|
|
import { SESSION_COOKIE_NAME } from "@/lib/auth/session";
|
|
import { withRouteLogging } from "@/lib/api/with-route-logging";
|
|
|
|
export const POST = withRouteLogging("auth.logout", async () => {
|
|
const res = NextResponse.json({ ok: true });
|
|
res.cookies.delete(SESSION_COOKIE_NAME);
|
|
return res;
|
|
});
|