chad/server/auth/lucia.ts
Никита Круглицкий bb48e52a99
Some checks failed
Deploy / deploy (push) Failing after 4m2s
update
2025-10-09 22:29:42 +06:00

21 lines
655 B
TypeScript

import { PrismaAdapter } from '@lucia-auth/adapter-prisma'
import { Lucia } from 'lucia'
import prisma from '../prisma/client'
export const auth = new Lucia<object, { username: string, displayName: string }>(new PrismaAdapter(prisma.session, prisma.user))
// export const auth = new Lucia({
// adapter: new PrismaAdapter(prisma.session, prisma.user),
// env: process.env.NODE_ENV === 'production' ? 'PROD' : 'DEV',
// middleware: req => ({
// headers: req.headers,
// }),
// transformUserData: user => ({
// id: user.id,
// username: user.username,
// displayName: user.username,
// }),
// })
export type Auth = typeof auth