summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Dessaux2022-11-01 01:46:40 +0100
committerJulien Dessaux2022-11-01 01:46:40 +0100
commit352fdde60b2e342dd142fb47c40c3ec1d5e3460a (patch)
tree54db833f82441097d130af751ddf10fda23b5298
parentAdded logout route, and a way to display the logout menu item on relevant pages (diff)
downloadjeux-de-mots-352fdde60b2e342dd142fb47c40c3ec1d5e3460a.tar.gz
jeux-de-mots-352fdde60b2e342dd142fb47c40c3ec1d5e3460a.tar.bz2
jeux-de-mots-352fdde60b2e342dd142fb47c40c3ec1d5e3460a.zip
Also clear browser cookie on logout
Diffstat (limited to '')
-rw-r--r--main.js1
-rw-r--r--routes/logout.js1
2 files changed, 2 insertions, 0 deletions
diff --git a/main.js b/main.js
index f4bd1a0..63528cc 100644
--- a/main.js
+++ b/main.js
@@ -7,6 +7,7 @@ import playRouter from "./routes/play.js";
import rootRouter from "./routes/root.js";
const app = express();
+app.set("trust proxy", 1);
app.use(helmet);
app.set("views", "./views");
diff --git a/routes/logout.js b/routes/logout.js
index a31d9fe..a92085a 100644
--- a/routes/logout.js
+++ b/routes/logout.js
@@ -7,6 +7,7 @@ router.use(session);
router.get("/", (req, res) => {
if (req.session.user !== undefined) {
+ res.clearCookie("JDMSessionId");
req.session.destroy();
}
return res.redirect(302, "/");