first commit
This commit is contained in:
10
app/api/auth/cookie-logout/route.ts
Normal file
10
app/api/auth/cookie-logout/route.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { cookies } from "next/headers";
|
||||
import { COOKIE_ACCESS, COOKIE_REFRESH, COOKIE_OPTS } from "@/lib/auth-cookies";
|
||||
|
||||
export async function POST() {
|
||||
const cookieStore = await cookies();
|
||||
cookieStore.set(COOKIE_ACCESS, "", { ...COOKIE_OPTS, maxAge: 0 });
|
||||
cookieStore.set(COOKIE_REFRESH, "", { ...COOKIE_OPTS, maxAge: 0 });
|
||||
return NextResponse.json({ ok: true });
|
||||
}
|
||||
Reference in New Issue
Block a user