Initial commit

This commit is contained in:
Developer
2026-02-06 21:44:04 -06:00
commit f85e93c7a6
151 changed files with 22916 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
import { NextRequest, NextResponse } from "next/server";
import { SESSION_COOKIE } from "../../../../lib/auth/session";
import { ok } from "../../../../lib/http";
export const runtime = "nodejs";
export async function POST(req: NextRequest) {
console.log("[LOGOUT] User logout");
const res = ok({ message: "Logged out successfully" });
// Clear the session cookie
res.cookies.set(SESSION_COOKIE, "", {
httpOnly: true,
sameSite: "lax",
secure: process.env.NODE_ENV === "production",
path: "/",
maxAge: 0,
});
console.log("[LOGOUT] Session cleared");
return res;
}