diff options
| author | Bobby <[email protected]> | 2022-06-26 20:31:28 +0530 |
|---|---|---|
| committer | Bobby <[email protected]> | 2022-06-26 20:31:28 +0530 |
| commit | 3dcda3b2772a1bfc8f8e6685ac03a9895dbed2ca (patch) | |
| tree | 80eceb76e78388361ca035f5055a6c588a0f11ae /server.js | |
| parent | fa5b05a4cbdeeca75b472ca152591e1428f5508e (diff) | |
| download | thatcomputerscientist-3dcda3b2772a1bfc8f8e6685ac03a9895dbed2ca.tar.xz thatcomputerscientist-3dcda3b2772a1bfc8f8e6685ac03a9895dbed2ca.zip | |
setting cookie domain using a global config file
Diffstat (limited to 'server.js')
| -rw-r--r-- | server.js | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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()); |
