From edbc9325462ddf4536775871ebc25e06f46612d1 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 24 Jul 2020 15:05:51 +0200 Subject: Add server API to abuse messages --- server/middlewares/user-right.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'server/middlewares/user-right.ts') diff --git a/server/middlewares/user-right.ts b/server/middlewares/user-right.ts index 4da7b9802..4d836485c 100644 --- a/server/middlewares/user-right.ts +++ b/server/middlewares/user-right.ts @@ -9,11 +9,7 @@ function ensureUserHasRight (userRight: UserRight) { const message = `User ${user.username} does not have right ${UserRight[userRight]} to access to ${req.path}.` logger.info(message) - return res.status(403) - .json({ - error: message - }) - .end() + return res.status(403).json({ error: message }) } return next() -- cgit v1.2.3