]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/middlewares/validators/blocklist.ts
Cleanup invalid rates/comments/shares
[github/Chocobozzz/PeerTube.git] / server / middlewares / validators / blocklist.ts
index d7ec649b6ea3138abc690e3900230472c0949984..f5b295f45808dd3a42aacf3ef3267a544b1d69f6 100644 (file)
@@ -20,7 +20,7 @@ const blockAccountValidator = [
     if (areValidationErrors(req, res)) return
     if (!await doesAccountNameWithHostExist(req.body.accountName, res)) return
 
-    const user = res.locals.oauth.token.User as UserModel
+    const user = res.locals.oauth.token.User
     const accountToBlock = res.locals.account
 
     if (user.Account.id === accountToBlock.id) {
@@ -44,7 +44,7 @@ const unblockAccountByAccountValidator = [
     if (areValidationErrors(req, res)) return
     if (!await doesAccountNameWithHostExist(req.params.accountName, res)) return
 
-    const user = res.locals.oauth.token.User as UserModel
+    const user = res.locals.oauth.token.User
     const targetAccount = res.locals.account
     if (!await doesUnblockAccountExist(user.Account.id, targetAccount.id, res)) return
 
@@ -106,7 +106,7 @@ const unblockServerByAccountValidator = [
 
     if (areValidationErrors(req, res)) return
 
-    const user = res.locals.oauth.token.User as UserModel
+    const user = res.locals.oauth.token.User
     if (!await doesUnblockServerExist(user.Account.id, req.params.host, res)) return
 
     return next()