import { Lucia } from "lucia"; import { PrismaAdapter } from "@lucia-auth/adapter-prisma"; import { PrismaClient } from "@prisma/client"; const client = new PrismaClient(); const adapter = new PrismaAdapter(client.session, client.user) // expect error (see next section) export const auth = new Lucia(adapter, { sessionCookie: { attributes: { // secure: process.env.NODE_ENV === "production" } }, getUserAttributes: (attributes)=>{ return { email: attributes.email } } }); declare module "lucia" { interface Register { Lucia: typeof Lucia; DatabaseUserAttributes: DatabaseUserAttributes } } interface DatabaseUserAttributes { email: string } export type Auth = typeof auth;