feat: Add authentication, file management with Cloudinary support, and Prisma-integrated file cleanup.

This commit is contained in:
2025-11-27 16:53:44 +03:00
parent 1c583af0ab
commit f07420e418
5 changed files with 13 additions and 9 deletions
+4 -3
View File
@@ -4,6 +4,7 @@ import { PrismaClient } from '@prisma/client';
import { admin } from 'better-auth/plugins';
import { applyFileCleanup } from '../prisma/file-cleanup.helper';
import { config } from '../shared/config/config';
const prisma = new PrismaClient();
applyFileCleanup(prisma);
@@ -27,12 +28,12 @@ export const auth = betterAuth({
sendOnSignIn: true,
autoSignInAfterVerification: true,
},
trustedOrigins: ['http://localhost:5173', 'http://localhost:5174'],
trustedOrigins: config.trustedOrigins,
socialProviders: {
google: {
prompt: 'select_account',
clientId: process.env.GOOGLE_CLIENT_ID!,
clientSecret: process.env.GOOGLE_CLIENT_SECRET!,
clientId: config.googleClientId,
clientSecret: config.googleClientSecret,
},
},
});