feat: add admin sign out
This commit is contained in:
1 parent
b1ab7b4c0c
commit
98d610271f
2 files changed
+57
-1
No files matched your search
@@ -0,0 +1,16 @@
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
const SESSION_COOKIE = "datastack_admin_session";
|
||||
|
||||
export async function POST() {
|
||||
const response = NextResponse.json({ success: true });
|
||||
response.cookies.set(SESSION_COOKIE, "", {
|
||||
httpOnly: true,
|
||||
secure: process.env.NODE_ENV === "production",
|
||||
sameSite: "strict",
|
||||
path: "/",
|
||||
maxAge: 0,
|
||||
expires: new Date(0),
|
||||
});
|
||||
return response;
|
||||
}
|
||||
Reference in new issue
Block a user