feat: send back 403 on no-privileges error

v1.18.x
Julian Lam 4 years ago
parent 222b4c9533
commit 14f9d8b0e5

@ -357,6 +357,13 @@ helpers.formatApiResponse = async (statusCode, res, payload) => {
message = payload.message; message = payload.message;
} }
// Update status code based on some common error codes
switch (payload.message) {
case '[[error:no-privileges]]':
statusCode = 403;
break;
}
const returnPayload = helpers.generateError(statusCode, message); const returnPayload = helpers.generateError(statusCode, message);
if (global.env === 'development') { if (global.env === 'development') {

Loading…
Cancel
Save