summaryrefslogtreecommitdiff
path: root/middlewares/sessions.js
diff options
context:
space:
mode:
authorJulien Dessaux2023-01-05 02:09:07 +0100
committerJulien Dessaux2023-01-05 02:09:07 +0100
commitd7ed1196bdd44d7734d41d91a5e72a71785e0a08 (patch)
treeaafae6571d5154dc5e9a061c8f54ca8e9b1287ad /middlewares/sessions.js
parentAdded more tests (diff)
downloadjeux-de-mots-d7ed1196bdd44d7734d41d91a5e72a71785e0a08.tar.gz
jeux-de-mots-d7ed1196bdd44d7734d41d91a5e72a71785e0a08.tar.bz2
jeux-de-mots-d7ed1196bdd44d7734d41d91a5e72a71785e0a08.zip
switched to single quotes string in eslint
Diffstat (limited to 'middlewares/sessions.js')
-rw-r--r--middlewares/sessions.js20
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;