From b0eaa858b5b987c2beb53b4d24b78020fb3a81b9 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 27 Dec 2018 16:50:41 -0500 Subject: [PATCH] fix: #7169 Fixed logout being broken --- src/controllers/authentication.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/controllers/authentication.js b/src/controllers/authentication.js index 33272da695..98b352050a 100644 --- a/src/controllers/authentication.js +++ b/src/controllers/authentication.js @@ -472,7 +472,8 @@ authenticationController.logout = function (req, res, next) { function (next) { req.logout(); req.session.regenerate(function (err) { - delete req.uid; + req.uid = 0; + req.headers['x-csrf-token'] = req.csrfToken(); next(err); }); },