From 4a251c1714ba4f79a59dd569583336eb910dbf73 Mon Sep 17 00:00:00 2001 From: Dan Mihailescu Date: Sun, 15 Dec 2024 12:46:37 -0500 Subject: [PATCH] main lucia set --- lucia.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lucia.ts b/lucia.ts index 67ef99a..bb5cda7 100644 --- a/lucia.ts +++ b/lucia.ts @@ -1,5 +1,4 @@ import { Lucia } from "lucia"; -//import { dev } from "$app/env"; import { PrismaAdapter } from "@lucia-auth/adapter-prisma"; import { PrismaClient } from "@prisma/client"; @@ -9,7 +8,7 @@ const adapter = new PrismaAdapter(client.session, client.user) export const auth = new Lucia(adapter, { sessionCookie: { attributes: { - // secure: !dev +// secure: process.env.NODE_ENV === "production" } }, getUserAttributes: (attributes)=>{ @@ -19,4 +18,15 @@ export const auth = new Lucia(adapter, { } }); +declare module "lucia" { + interface Register { + Lucia: typeof Lucia; + DatabaseUserAttributes: DatabaseUserAttributes + } +} + +interface DatabaseUserAttributes { + email: string +} + export type Auth = typeof auth; \ No newline at end of file