feat(project): init

This commit is contained in:
zhangheng
2026-04-25 11:26:33 +08:00
commit 9bf212f67c
63 changed files with 11141 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
import { NextResponse, type NextRequest } from "next/server";
import { SESSION_COOKIE_NAME, clearSessionById } from "@/lib/auth";
export const runtime = "nodejs";
export async function POST(request: NextRequest) {
const sessionId = request.cookies.get(SESSION_COOKIE_NAME)?.value;
clearSessionById(sessionId);
const response = NextResponse.json({ ok: true });
response.cookies.set(SESSION_COOKIE_NAME, "", {
httpOnly: true,
secure: process.env.NODE_ENV === "production",
sameSite: "lax",
path: "/",
expires: new Date(0),
});
return response;
}