Applicatie afmaken en GUI-flow herstellen
Voegt boodschappenlijsten, productbeheer, realtime synchronisatie en browsercache-updates toe. Herstelt login- en sessiegedrag en maakt database-seeding herhaalbaar.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
+7
-3
@@ -1,8 +1,9 @@
|
||||
const session = require("express-session");
|
||||
const BetterSqlite3Store = require("better-sqlite3-session-store")(session);
|
||||
const Database = require("better-sqlite3");
|
||||
const path = require("path");
|
||||
|
||||
const db = new Database("sessions.sqlite");
|
||||
const db = new Database(path.join(__dirname, "..", "sessions.sqlite"));
|
||||
|
||||
module.exports = session({
|
||||
|
||||
@@ -14,14 +15,17 @@ module.exports = session({
|
||||
}
|
||||
}),
|
||||
|
||||
secret: process.env.SESSION_SECRET,
|
||||
secret: process.env.SESSION_SECRET || "change-this-development-secret",
|
||||
|
||||
resave: false,
|
||||
|
||||
saveUninitialized: false,
|
||||
|
||||
cookie: {
|
||||
maxAge: 1000 * 60 * 60 * 24 * 30
|
||||
maxAge: 1000 * 60 * 60 * 24 * 30,
|
||||
httpOnly: true,
|
||||
sameSite: "lax",
|
||||
secure: process.env.NODE_ENV === "production"
|
||||
}
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user