initial commit
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
import { betterAuth } from "better-auth/minimal";
|
||||
import { drizzleAdapter } from "better-auth/adapters/drizzle";
|
||||
import * as schema from "~~/db/schema";
|
||||
import { useDrizzle } from "~~/server/utils/drizzle";
|
||||
|
||||
export const auth = betterAuth({
|
||||
database: drizzleAdapter(useDrizzle(), {
|
||||
provider: "pg",
|
||||
schema: {
|
||||
...schema
|
||||
}
|
||||
}),
|
||||
|
||||
emailAndPassword: {
|
||||
// if DISABLE_LOCAL_AUTH is set to "1" or "true" then local auth is disabled
|
||||
enabled: process.env.DISABLE_LOCAL_AUTH?.toLowerCase() !== "true" && process.env.DISABLE_LOCAL_AUTH !== "1",
|
||||
disableSignUp: process.env.DISABLE_SIGNUP?.toLowerCase() === "true" || process.env.DISABLE_SIGNUP === "1",
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user