update
Some checks failed
Deploy / deploy (push) Failing after 4m2s

This commit is contained in:
Никита Круглицкий
2025-10-09 22:29:42 +06:00
parent 6ada2c3fbd
commit bb48e52a99
14 changed files with 1234 additions and 15 deletions

20
server/auth/lucia.ts Normal file
View File

@@ -0,0 +1,20 @@
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