Initial commit from create-turbo

This commit is contained in:
TZGyn
2026-05-09 15:27:01 +08:00
commit 22064d4bc4
482 changed files with 15482 additions and 0 deletions
+46
View File
@@ -0,0 +1,46 @@
import { betterAuth } from 'better-auth'
import { drizzleAdapter } from '@better-auth/drizzle-adapter'
import { db } from './db'
import * as schema from './db/schema'
import { openAPI, username } from 'better-auth/plugins'
export const auth = betterAuth({
// baseURL: Bun.env.API_URL,
// trustedOrigins: [Bun.env.APP_URL!],
basePath: '/auth',
// secret: Bun.env.BETTER_AUTH_SECRET,
database: drizzleAdapter(db, {
provider: 'pg',
schema: schema,
}),
emailAndPassword: {
enabled: true,
disableSignUp: false,
},
socialProviders: {
// google: {
// prompt: 'select_account consent',
// enabled:
// !!Bun.env.GOOGLE_OAUTH_CLIENT_ID &&
// !!Bun.env.GOOGLE_OAUTH_CLIENT_SECRET,
// clientId: Bun.env.GOOGLE_OAUTH_CLIENT_ID!,
// clientSecret: Bun.env.GOOGLE_OAUTH_CLIENT_SECRET!,
// scope: [
// 'https://www.googleapis.com/auth/userinfo.profile',
// 'https://www.googleapis.com/auth/userinfo.email',
// ],
// },
},
user: {
changeEmail: {
enabled: true,
},
deleteUser: {
enabled: true,
},
},
telemetry: {
enabled: false,
},
plugins: [username(), openAPI()],
})