Skip to content

Node.js based forum software built for the modern web

fix: show access denied instead of internal error

Barış Soner Uşaklı7dd143e1f88d
diff --git a/src/controllers/accounts/chats.js b/src/controllers/accounts/chats.js
index 221e1f5fae..d8555967df 100644
--- a/src/controllers/accounts/chats.js
+++ b/src/controllers/accounts/chats.js
@@ -20,7 +20,7 @@ chatsController.get = async function (req, res, next) {
}
const canChat = await privileges.global.can('chat', req.uid);
if (!canChat) {
- return next(new Error('[[error:no-privileges]]'));
+ return helpers.notAllowed(req, res, '[[error:no-privileges]]');
}
const payload = {