gestion supp user admin

This commit is contained in:
2026-05-11 22:55:30 +02:00
parent 2cab2ddd1d
commit 01cf4dd5a1
17 changed files with 728 additions and 8 deletions

View File

@@ -56,6 +56,14 @@ export async function POST(request: NextRequest) {
);
}
// Check if account is marked for deletion
if (user.deletedAt) {
return NextResponse.json(
{ error: 'Votre compte est désactivé. Veuillez le réactiver via le lien envoyé par email ou contacter le support.' },
{ status: 403 }
);
}
// Omit password from response
const { password: _, ...userWithoutPassword } = user;