moved into correct folder

This commit is contained in:
Dan Mihailescu 2024-12-15 13:41:52 -05:00
parent 4a251c1714
commit 331cd2f4f9

32
src/lib/server/lucia.ts Normal file
View file

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