feat: Implement file cleanup middleware for automatic old file deletion using local and Cloudinary storage providers.

This commit is contained in:
2025-11-27 16:20:55 +03:00
parent bf9988d9bc
commit 1c583af0ab
10 changed files with 299 additions and 2 deletions
+3
View File
@@ -3,7 +3,10 @@ import { prismaAdapter } from 'better-auth/adapters/prisma';
import { PrismaClient } from '@prisma/client';
import { admin } from 'better-auth/plugins';
import { applyFileCleanup } from '../prisma/file-cleanup.helper';
const prisma = new PrismaClient();
applyFileCleanup(prisma);
export const auth = betterAuth({
database: prismaAdapter(prisma, {