Revert "fix: restore old behaviour of empty json w/ 401 code in admin middleware" [breaking]

This reverts commit dda5d42610.

re: #11099
This commit is contained in:
Julian Lam
2022-12-16 11:52:41 -05:00
parent 35b5ae195f
commit 00aef13dd3

View File

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