X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmiddlewares%2Fvalidators%2Fblocklist.ts;h=f5b295f45808dd3a42aacf3ef3267a544b1d69f6;hb=2ba92871319d7af63472c1380664a9f9eeb1c690;hp=d7ec649b6ea3138abc690e3900230472c0949984;hpb=0f6acda11681de90d38dd18669863c6e270851ee;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/middlewares/validators/blocklist.ts b/server/middlewares/validators/blocklist.ts index d7ec649b6..f5b295f45 100644 --- a/server/middlewares/validators/blocklist.ts +++ b/server/middlewares/validators/blocklist.ts @@ -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()