diff --git a/src/db/db.js b/src/db/db.js index f65f7cd..57ba5e9 100644 --- a/src/db/db.js +++ b/src/db/db.js @@ -37,8 +37,7 @@ const storeDB = (() => { })(); const store = new SequelizeStore({ - db: storeDB, - expiration: process.env.COOKIE_EXPIRY_DURATION, + db: storeDB }); const Contact = sequelize.define("Contact", { diff --git a/src/routes/VerifyRoute.js b/src/routes/VerifyRoute.js index 0611de9..7a984ba 100644 --- a/src/routes/VerifyRoute.js +++ b/src/routes/VerifyRoute.js @@ -1,8 +1,7 @@ const { User } = require("../db/db"); const { addContact } = require("../db/utils"); -function VerifyRoute() { - (req, res) => { +function VerifyRoute(req, res) { checkVerification(req.body.id, (success, msg, withUserID) => { req.session.verified = success; req.session.verifiedBy = withUserID; @@ -23,7 +22,6 @@ function VerifyRoute() { res.status(400).send({ success: success, message: msg }); } }); - }; } function checkVerification(id, done) { diff --git a/src/session.js b/src/session.js index aa81029..4812e45 100644 --- a/src/session.js +++ b/src/session.js @@ -7,6 +7,7 @@ const sessionOpts = { cookie: { secure: true, sameSite: "none", + maxAge: Number(process.env.SESSION_LENGTH), }, store: store, };