From 7dd143e1f88d91ad9fe01c01443347c953c14a1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Fri, 18 Aug 2023 21:40:39 -0400 Subject: [PATCH] fix: show access denied instead of internal error when user doesn't have access to chats --- src/controllers/accounts/chats.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 = {