]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/middlewares/user-right.ts
Add server API to abuse messages
[github/Chocobozzz/PeerTube.git] / server / middlewares / user-right.ts
index 4da7b9802516d02c0ac028557e15878dc119bb8a..4d836485ccc4ec7513170dd3029b1418cc2e84ae 100644 (file)
@@ -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()