moved into correct folder
This commit is contained in:
parent
4a251c1714
commit
331cd2f4f9
1 changed files with 0 additions and 0 deletions
32
src/lib/server/lucia.ts
Normal file
32
src/lib/server/lucia.ts
Normal 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;
|
||||
Loading…
Add table
Add a link
Reference in a new issue