Files
KART-FRONT-NEXT/src/app/api/logout/[[...slug]]/route.ts

13 lines
386 B
TypeScript

import { NextResponse } from "next/server";
import { setAuthCookie } from "@/lib/auth-cookie";
/** Stateless backend authentication has no logout API; discard the frontend session cookie. */
export async function POST() {
const response = NextResponse.json(
{ ok: true },
{ headers: { "Cache-Control": "no-store" } },
);
setAuthCookie(response, "");
return response;
}