[bug] req.locales should include unpublished, if on home

This commit is contained in:
Andrea 2021-12-28 12:35:50 +01:00
parent 48c5962efb
commit 23b59816c8
1 changed files with 1 additions and 1 deletions

View File

@ -66,7 +66,7 @@ app.use(async function (req, res, next) {
req.rawUser = authenticate(req);
req.user = req.rawUser && req.rawUser.authenticated ? req.rawUser : null;
req.isGranted = (area = '', locale = global.config.locale) => req.user && isGranted(req.user, locale, area);
req.locales = buildLocaleList();
req.locales = buildLocaleList(global.config.locale, global.config.locale === '_');
req.db = new LazyDatabase();
req.isUserAllowedToPost = async () => {
const user = await req.db.get(SQL`SELECT bannedReason FROM users WHERE id = ${req.user.id}`);