Skip to content

Commit

Permalink
fix: show access denied instead of internal error
Browse files Browse the repository at this point in the history
when user doesn't have access to chats
  • Loading branch information
barisusakli committed Aug 19, 2023
1 parent cbc092b commit 7dd143e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/controllers/accounts/chats.js
Expand Up @@ -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 = {
Expand Down

0 comments on commit 7dd143e

Please sign in to comment.