diff options
Diffstat (limited to 'server/middlewares')
-rw-r--r-- | server/middlewares/validators/feeds.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/server/middlewares/validators/feeds.ts b/server/middlewares/validators/feeds.ts index 5c76a679f..35080ffca 100644 --- a/server/middlewares/validators/feeds.ts +++ b/server/middlewares/validators/feeds.ts | |||
@@ -64,8 +64,8 @@ const videoFeedsValidator = [ | |||
64 | ] | 64 | ] |
65 | 65 | ||
66 | const videoSubscriptonFeedsValidator = [ | 66 | const videoSubscriptonFeedsValidator = [ |
67 | query('accountId').optional().custom(isIdValid), | 67 | query('accountId').custom(isIdValid), |
68 | query('token').optional(), | 68 | query('token'), |
69 | 69 | ||
70 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 70 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |
71 | logger.debug('Checking feeds parameters', { parameters: req.query }) | 71 | logger.debug('Checking feeds parameters', { parameters: req.query }) |
@@ -74,6 +74,7 @@ const videoSubscriptonFeedsValidator = [ | |||
74 | 74 | ||
75 | // a token alone is erroneous | 75 | // a token alone is erroneous |
76 | if (req.query.token && !req.query.accountId) return | 76 | if (req.query.token && !req.query.accountId) return |
77 | if (req.query.accountId && !await doesAccountIdExist(req.query.accountId, res)) return | ||
77 | if (req.query.token && !await doesUserFeedTokenCorrespond(res.locals.account.userId, req.query.token, res)) return | 78 | if (req.query.token && !await doesUserFeedTokenCorrespond(res.locals.account.userId, req.query.token, res)) return |
78 | 79 | ||
79 | return next() | 80 | return next() |