куча говна
All checks were successful
Deploy / deploy (push) Successful in 4m32s

This commit is contained in:
Никита Круглицкий
2025-10-20 00:10:13 +06:00
parent 31460598ba
commit ec67be8aa6
50 changed files with 1616 additions and 1011 deletions

View File

@@ -1,7 +1,29 @@
import { PrismaAdapter } from '@lucia-auth/adapter-prisma'
import { Lucia } from 'lucia'
import prisma from '../prisma/client'
import prisma from '../prisma/client.ts'
export const auth = new Lucia<object, { username: string, displayName: string }>(new PrismaAdapter(prisma.session, prisma.user))
declare module 'lucia' {
interface Register {
Lucia: typeof Lucia
UserId: string
DatabaseUserAttributes: DatabaseUserAttributes
}
}
interface DatabaseUserAttributes {
id: string
displayName: string
username: string
}
export const auth = new Lucia(new PrismaAdapter(prisma.session, prisma.user), {
getUserAttributes: ({ id, displayName, username }) => {
return {
id,
displayName,
username,
}
},
})
export type Auth = typeof auth