feat(profile): add account deletion with confirmation and update privacy policy

This commit is contained in:
jessy-david-dev
2026-04-10 19:24:12 +02:00
parent cd5f2bdf3f
commit 2242adc011
3 changed files with 66 additions and 1 deletions
+14
View File
@@ -0,0 +1,14 @@
import { NextResponse } from "next/server";
import { auth } from "../../../auth";
import { prisma } from "../../../lib/prisma";
export async function DELETE() {
const session = await auth();
if (!session?.user?.id) {
return NextResponse.json({ error: "Non connecté" }, { status: 401 });
}
await prisma.user.delete({ where: { id: session.user.id } });
return NextResponse.json({ ok: true });
}