diff options
Diffstat (limited to 'server/middlewares/validators/blocklist.ts')
-rw-r--r-- | server/middlewares/validators/blocklist.ts | 6 |
1 files changed, 3 insertions, 3 deletions
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 = [ | |||
20 | if (areValidationErrors(req, res)) return | 20 | if (areValidationErrors(req, res)) return |
21 | if (!await doesAccountNameWithHostExist(req.body.accountName, res)) return | 21 | if (!await doesAccountNameWithHostExist(req.body.accountName, res)) return |
22 | 22 | ||
23 | const user = res.locals.oauth.token.User as UserModel | 23 | const user = res.locals.oauth.token.User |
24 | const accountToBlock = res.locals.account | 24 | const accountToBlock = res.locals.account |
25 | 25 | ||
26 | if (user.Account.id === accountToBlock.id) { | 26 | if (user.Account.id === accountToBlock.id) { |
@@ -44,7 +44,7 @@ const unblockAccountByAccountValidator = [ | |||
44 | if (areValidationErrors(req, res)) return | 44 | if (areValidationErrors(req, res)) return |
45 | if (!await doesAccountNameWithHostExist(req.params.accountName, res)) return | 45 | if (!await doesAccountNameWithHostExist(req.params.accountName, res)) return |
46 | 46 | ||
47 | const user = res.locals.oauth.token.User as UserModel | 47 | const user = res.locals.oauth.token.User |
48 | const targetAccount = res.locals.account | 48 | const targetAccount = res.locals.account |
49 | if (!await doesUnblockAccountExist(user.Account.id, targetAccount.id, res)) return | 49 | if (!await doesUnblockAccountExist(user.Account.id, targetAccount.id, res)) return |
50 | 50 | ||
@@ -106,7 +106,7 @@ const unblockServerByAccountValidator = [ | |||
106 | 106 | ||
107 | if (areValidationErrors(req, res)) return | 107 | if (areValidationErrors(req, res)) return |
108 | 108 | ||
109 | const user = res.locals.oauth.token.User as UserModel | 109 | const user = res.locals.oauth.token.User |
110 | if (!await doesUnblockServerExist(user.Account.id, req.params.host, res)) return | 110 | if (!await doesUnblockServerExist(user.Account.id, req.params.host, res)) return |
111 | 111 | ||
112 | return next() | 112 | return next() |