mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-02 09:05:49 +02:00
use config file instead of env
This commit is contained in:
parent
6fb569e2cd
commit
d9ae322e2a
19 changed files with 189 additions and 209 deletions
|
@ -5,6 +5,7 @@ import { Lucia, TimeSpan } from "lucia";
|
|||
import { DrizzleSQLiteAdapter } from "@lucia-auth/adapter-drizzle";
|
||||
import db from "@server/db";
|
||||
import { sessions, users } from "@server/db/schema";
|
||||
import config from "@server/config";
|
||||
|
||||
const adapter = new DrizzleSQLiteAdapter(db, sessions, users);
|
||||
|
||||
|
@ -18,19 +19,18 @@ export const lucia = new Lucia(adapter, {
|
|||
dateCreated: attributes.dateCreated,
|
||||
};
|
||||
},
|
||||
// getSessionAttributes: (attributes) => {
|
||||
// return {
|
||||
// country: attributes.country,
|
||||
// };
|
||||
// },
|
||||
sessionCookie: {
|
||||
name: "session",
|
||||
expires: false,
|
||||
attributes: {
|
||||
// secure: environment.ENVIRONMENT === "prod",
|
||||
// sameSite: "strict",
|
||||
secure: false,
|
||||
domain: ".testing123.io",
|
||||
sameSite: "strict",
|
||||
secure: config.app.secure_cookies || false,
|
||||
domain:
|
||||
"." +
|
||||
config.app.external_base_url
|
||||
.split("://")[1]
|
||||
.split(":")[0]
|
||||
.split("/")[0],
|
||||
},
|
||||
},
|
||||
sessionExpiresIn: new TimeSpan(2, "w"),
|
||||
|
@ -42,7 +42,6 @@ declare module "lucia" {
|
|||
interface Register {
|
||||
Lucia: typeof lucia;
|
||||
DatabaseUserAttributes: DatabaseUserAttributes;
|
||||
DatabaseSessionAttributes: DatabaseSessionAttributes;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -54,7 +53,3 @@ interface DatabaseUserAttributes {
|
|||
emailVerified: boolean;
|
||||
dateCreated: string;
|
||||
}
|
||||
|
||||
interface DatabaseSessionAttributes {
|
||||
// country: string;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue