aboutsummaryrefslogtreecommitdiff
path: root/server.js
diff options
context:
space:
mode:
authorBobby <[email protected]>2022-06-26 20:31:28 +0530
committerBobby <[email protected]>2022-06-26 20:31:28 +0530
commit3dcda3b2772a1bfc8f8e6685ac03a9895dbed2ca (patch)
tree80eceb76e78388361ca035f5055a6c588a0f11ae /server.js
parentfa5b05a4cbdeeca75b472ca152591e1428f5508e (diff)
downloadthatcomputerscientist-3dcda3b2772a1bfc8f8e6685ac03a9895dbed2ca.tar.xz
thatcomputerscientist-3dcda3b2772a1bfc8f8e6685ac03a9895dbed2ca.zip
setting cookie domain using a global config file
Diffstat (limited to 'server.js')
-rw-r--r--server.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/server.js b/server.js
index 50ab058c..dc9db265 100644
--- a/server.js
+++ b/server.js
@@ -9,7 +9,6 @@ const port = process.env.PORT || 3000;
const connectionURL = process.env.DATABASE_URL;
const cron = require("node-cron");
const subdomains = require("wildcard-subdomains");
-
require("dotenv").config();
// Middleware
@@ -21,9 +20,11 @@ app.use(
expressSession({
cookie: {
maxAge: 30 * 24 * 60 * 60 * 1000,
- domain: ".thatcomputerscientist.com",
+ domain: require("yaml").parse(require("fs").readFileSync("config.yml", "utf8")).domain,
},
secret: process.env.AUTHORIZATION_STRING,
+ resave: true,
+ saveUninitialized: true
})
);
app.use(flash());