fix: restore old behaviour of empty json w/ 401 code in admin middleware

v1.18.x
Julian Lam 4 years ago
parent 15e0731dd9
commit dda5d42610

@ -147,7 +147,7 @@ middleware.checkPrivileges = helpers.try(async (req, res, next) => {
req.session.returnTo = returnTo; req.session.returnTo = returnTo;
req.session.forceLogin = 1; req.session.forceLogin = 1;
if (res.locals.isAPI) { if (res.locals.isAPI) {
controllers.helpers.formatApiResponse(401, res); res.status(401).json({});
} else { } else {
res.redirect(nconf.get('relative_path') + '/login?local=1'); res.redirect(nconf.get('relative_path') + '/login?local=1');
} }

Loading…
Cancel
Save