From 097bb51577fb26f8e22f86dc274cb670ab606a8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Zanghelini?= Date: Sat, 3 Jun 2017 16:42:15 -0300 Subject: [PATCH] Logout without scripts --- src/controllers/authentication.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/controllers/authentication.js b/src/controllers/authentication.js index 5309bdc380..1e6c2d7df8 100644 --- a/src/controllers/authentication.js +++ b/src/controllers/authentication.js @@ -404,7 +404,11 @@ authenticationController.logout = function (req, res, next) { function () { // Force session check for all connected socket.io clients with the same session id sockets.in('sess_' + req.sessionID).emit('checkSession', 0); - res.status(200).send(''); + if (req.body.noscript === 'true') { + res.redirect(nconf.get('relative_path') + '/'); + } else { + res.status(200).send(''); + } }, ], next); };