This commit is contained in:
2026-09-03 17:56:47 +03:00
commit 33490da091
136 changed files with 20062 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
import { betterAuth } from 'better-auth';
import { Pool } from 'pg';
import { dbConfig } from '../configs/db.config.js';
export const auth = betterAuth({
database: new Pool({
host: dbConfig.host,
port: dbConfig.port,
user: dbConfig.username,
password: dbConfig.password,
database: dbConfig.database,
}),
secret: process.env.BETTER_AUTH_SECRET,
baseURL: process.env.BETTER_AUTH_URL ?? 'http://localhost:3000',
emailAndPassword: {
enabled: true,
},
});