fix: #7038, autoLocale logic not playing nicely with no-refresh auths (#7059)

* fix: #7038, autoLocale logic not playing nicely with no-refresh auths

- on login, req.query.lang is deleted (since it seems to be left over)
- on logout, the middleware.autoLocale is executed, which resets
  req.query.lang
- middleware.autoLocale is new, just refactored existing logic in
  webserver.js into new middleware method.

* style: tests, use lodash

* fix: timeago strings not switching languages on login or out
This commit is contained in:
Julian Lam
2018-12-07 11:29:20 -05:00
committed by GitHub
parent 72f56d7f49
commit 5f3d1c76c8
6 changed files with 56 additions and 42 deletions

View File

@@ -284,6 +284,8 @@ function continueLogin(req, res, next) {
});
});
} else {
delete req.query.lang;
async.parallel({
doLogin: async.apply(authenticationController.doLogin, req, userData.uid),
header: async.apply(middleware.generateHeader, req, res, {}),