This commit is contained in:
2024-12-09 09:10:16 +08:00
parent 758626f2b0
commit 1dfaa4bb74
4 changed files with 69 additions and 66 deletions

View File

@@ -1,4 +1,3 @@
import { prisma } from "@/app/lib";
import { cookies } from "next/headers";
import { NextRequest, NextResponse } from "next/server";
export const dynamic = "force-dynamic";
@@ -7,15 +6,15 @@ export async function GET(request: NextRequest) {
// const { searchParams } = new URL(request.url);
// const id = searchParams.get("id");
const delToken = await prisma.userSession.delete({
where: {
userId: id as string,
},
});
// const delToken = await prisma.userSession.delete({
// where: {
// userId: id as string,
// },
// });
const del = cookies().delete(process.env.NEXT_PUBLIC_BASE_SESSION_KEY!);
return NextResponse.json(
{ success: true, message: "Logout Berhasil" },
{ status: 200 }
);
}
}