This commit is contained in:
eric
2026-03-12 05:41:01 -05:00
parent 39a8358af1
commit 4a223cd788
5 changed files with 28 additions and 14 deletions

View File

@@ -1,10 +1,15 @@
import { NextResponse } from "next/server";
import { NextRequest, NextResponse } from "next/server";
import { getAuthCookieDomain } from "@/app/lib/auth-cookie-domain";
const COOKIE_NAME = "pb_session";
const COOKIE_DOMAIN = process.env.AUTH_COOKIE_DOMAIN || ".hackrobot.cn";
export async function POST() {
export async function POST(request: NextRequest) {
const domain = getAuthCookieDomain(request);
const res = NextResponse.json({ ok: true });
res.cookies.set(COOKIE_NAME, "", { domain: COOKIE_DOMAIN, path: "/", maxAge: 0 });
res.cookies.set(COOKIE_NAME, "", {
...(domain && { domain }),
path: "/",
maxAge: 0,
});
return res;
}