20
server/auth/lucia.ts
Normal file
20
server/auth/lucia.ts
Normal 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
|
||||
Reference in New Issue
Block a user