Skip to content

Commit

Permalink
fix: restore old behaviour of empty json w/ 401 code in admin middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
julianlam committed Oct 30, 2020
1 parent 15e0731 commit dda5d42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/middleware/admin.js
Expand Up @@ -147,7 +147,7 @@ middleware.checkPrivileges = helpers.try(async (req, res, next) => {
req.session.returnTo = returnTo;
req.session.forceLogin = 1;
if (res.locals.isAPI) {
controllers.helpers.formatApiResponse(401, res);
res.status(401).json({});
} else {
res.redirect(nconf.get('relative_path') + '/login?local=1');
}
Expand Down

0 comments on commit dda5d42

Please sign in to comment.