fix: show access denied instead of internal error

when user doesn't have access to chats
isekai-main
Barış Soner Uşaklı 1 year ago
parent cbc092be1e
commit 7dd143e1f8

@ -20,7 +20,7 @@ chatsController.get = async function (req, res, next) {
} }
const canChat = await privileges.global.can('chat', req.uid); const canChat = await privileges.global.can('chat', req.uid);
if (!canChat) { if (!canChat) {
return next(new Error('[[error:no-privileges]]')); return helpers.notAllowed(req, res, '[[error:no-privileges]]');
} }
const payload = { const payload = {

Loading…
Cancel
Save