stage 1
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { destroyCurrentSession, getSessionUser } from "@/lib/session";
|
||||
import { audit } from "@/lib/audit";
|
||||
|
||||
export async function POST() {
|
||||
const user = await getSessionUser();
|
||||
await destroyCurrentSession();
|
||||
if (user) {
|
||||
await audit({ actorId: user.id, action: "logout", entity: "User", entityId: user.id });
|
||||
}
|
||||
return NextResponse.json({ ok: true });
|
||||
}
|
||||
Reference in New Issue
Block a user