diff options
Diffstat (limited to '')
-rw-r--r-- | middlewares/sessions.js | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/middlewares/sessions.js b/middlewares/sessions.js index 901c262..30f5c49 100644 --- a/middlewares/sessions.js +++ b/middlewares/sessions.js @@ -1,21 +1,21 @@ -import expressSession from "express-session"; -import Database from "better-sqlite3"; -import sqliteStore from "better-sqlite3-session-store"; +import expressSession from 'express-session'; +import Database from 'better-sqlite3'; +import sqliteStore from 'better-sqlite3-session-store'; const SqliteStore = sqliteStore(expressSession); const db = new Database( - process.env.NODE_ENV === "test" ? "testsessions.db" : "sessions.db", - process.env.NODE_ENV === "development" ? { verbose: console.log } : null + process.env.NODE_ENV === 'test' ? 'testsessions.db' : 'sessions.db', + process.env.NODE_ENV === 'development' ? { verbose: console.log } : null ); -const secret = process.env.SESSION_SECRET || "secret"; +const secret = process.env.SESSION_SECRET || 'secret'; const session = expressSession({ cookie: { httpOnly: true, maxAge: 1000 * 60 * 60 * 24 * 15, // 15 days - sameSite: "Strict", - secure: process.env.NODE_ENV === "production" ? true : false, + sameSite: 'Strict', + secure: process.env.NODE_ENV === 'production' ? true : false, }, - name: "JDMSessionId", + name: 'JDMSessionId', saveUninitialized: false, secret: secret, store: new SqliteStore({ @@ -26,7 +26,7 @@ const session = expressSession({ } }), resave: false, - unset: "destroy", + unset: 'destroy', }); export default session; |