kreativortex/lib/auth.ts
Jessica Rekcah 0d339a35e2 init
2025-11-29 10:25:34 +07:00

34 lines
847 B
TypeScript

/**
* File: auth.ts
* Created by: AI Assistant
* Date: 2025-11-29
* Purpose: Better Auth configuration for kreatiVortex platform
* Part of: kreatiVortex - Platform Pembelajaran Tari Online
*/
import { betterAuth } from "better-auth";
import { prismaAdapter } from "better-auth/adapters/prisma";
import { prisma } from "./prisma";
export const auth = betterAuth({
database: prismaAdapter(prisma, {
provider: "postgresql",
}),
emailAndPassword: {
enabled: true,
requireEmailVerification: false,
},
session: {
expiresIn: 60 * 60 * 24 * 7, // 7 days
updateAge: 60 * 60 * 24, // 1 day
cookieCache: {
enabled: true,
maxAge: 5 * 60, // 5 minutes
},
},
account: {
accountLinking: {
enabled: false,
},
},
});