nomadro/apps/nomadvip/app/api/auth/logout/route.ts
eric 56b29205e7 Integrate four verticals into nomadro portal with shared packages and API gateway.
Mount /vip with nomadvip+payjsapi, add @nomadro/pay|pb|sdk, apps/api, /admin shell, and backup/rollback scripts under git.nomadro.cn workflow.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-28 20:16:44 -05:00

24 lines
733 B
TypeScript

import { NextRequest, NextResponse } from "next/server";
import { COOKIE_NAME, getCookieOptions, getHostFromRequest } from "@vip/app/lib/auth-cookie";
const ANONYMOUS_USER_COOKIE_NAME = "nomadvip_anon_uid";
const PAY_ORDER_COOKIE_NAME = "nomadvip_pay_order";
export async function POST(request: NextRequest) {
const res = NextResponse.json({ ok: true });
const options = getCookieOptions(true, getHostFromRequest(request)) as Record<
string,
string | number | boolean
>;
res.cookies.set(COOKIE_NAME, "", options);
res.cookies.set(ANONYMOUS_USER_COOKIE_NAME, "", {
...options,
httpOnly: false,
});
res.cookies.set(PAY_ORDER_COOKIE_NAME, "", {
...options,
httpOnly: false,
});
return res;
}