chore: rename aelis to freya

This commit is contained in:
2026-06-12 17:32:20 +01:00
parent 7e77870c13
commit de91dfc2a2
247 changed files with 585 additions and 585 deletions

View File

@@ -0,0 +1,29 @@
import { betterAuth } from "better-auth"
import { drizzleAdapter } from "better-auth/adapters/drizzle"
import { admin } from "better-auth/plugins"
import type { Database } from "../db/index.ts"
import * as schema from "../db/schema.ts"
export function createAuth(db: Database) {
if (!process.env.BETTER_AUTH_SECRET) {
throw new Error("BETTER_AUTH_SECRET is not set")
}
return betterAuth({
database: drizzleAdapter(db, {
provider: "pg",
schema,
}),
advanced: {
disableCSRFCheck: process.env.NODE_ENV !== "production",
},
emailAndPassword: {
enabled: true,
},
plugins: [admin()],
})
}
export type Auth = ReturnType<typeof createAuth>