-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathhelper.ts
More file actions
48 lines (42 loc) · 1.08 KB
/
helper.ts
File metadata and controls
48 lines (42 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { drizzle } from 'drizzle-orm/node-postgres'
import { Pool } from 'pg'
import { Builder, defineBaseConfig } from '@kivotos/core'
import * as schema from '~/db/schema'
const pool = new Pool({
connectionString: process.env.DATABASE_URL,
})
const db = drizzle({ client: pool, schema: schema, logger: true })
export const baseConfig = defineBaseConfig({
db: db,
schema: schema,
auth: {
resetPassword: {
enabled: true,
async sendEmailResetPassword(email, token) {
console.log('sendEmailResetPassword config', email, token)
return
},
},
user: {
model: schema.users,
},
session: {
model: schema.sessions,
},
account: {
model: schema.accounts,
},
verification: {
model: schema.verifications,
},
emailAndPassword: {
enabled: true,
// sendEmailVerfication(email) {
// console.log('sendEmailVerfication', email)
// },
// skipEmailVerification: false,
},
secret: '',
},
})
export const builder = new Builder(baseConfig).$context<typeof baseConfig.context>()