From 900f0a0b7865a50372acafa99431bd8f47007481 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 20 Dec 2018 13:59:34 -0500 Subject: [PATCH] fix: #7118, invoking autoLocale middleware on logout Also: - firing client-side hook on header update - updating bootbox locale on header update --- public/src/app.js | 2 ++ src/controllers/authentication.js | 1 + 2 files changed, 3 insertions(+) diff --git a/public/src/app.js b/public/src/app.js index 2312a57a53..943eacf67a 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -147,6 +147,8 @@ app.cacheBuster = null; Chat.prepareDOM(); app.reskin(data.config.bootswatchSkin); translator.switchTimeagoLanguage(callback); + bootbox.setLocale(config.userLang); + $(window).trigger('action:app.updateHeader'); }); }); }; diff --git a/src/controllers/authentication.js b/src/controllers/authentication.js index b2f456691d..e85c38e0f9 100644 --- a/src/controllers/authentication.js +++ b/src/controllers/authentication.js @@ -483,6 +483,7 @@ authenticationController.logout = function (req, res, next) { function (next) { plugins.fireHook('static:user.loggedOut', { req: req, res: res, uid: req.uid }, next); }, + async.apply(middleware.autoLocale, req, res), function () { // Force session check for all connected socket.io clients with the same session id sockets.in('sess_' + req.sessionID).emit('checkSession', 0);