| 1234567891011121314151617 |
- // app/api/auth/logout/route.js
- import { NextResponse } from "next/server";
- export async function GET() {
- const response = NextResponse.json({ message: "Logout successful" });
- response.cookies.set("authToken", "", {
- path: "/",
- expires: new Date(0),
- httpOnly: true,
- secure: process.env.NODE_ENV === "production",
- });
- response.headers.set("Cache-Control", "no-store"); // Caching verhindern
- return response;
- }
|