aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-09-16 10:58:13 +0200
committerChocobozzz <me@florianbigard.com>2022-09-16 10:58:13 +0200
commit8a6828b1664ce3fc535d23c54ed22bab35588d06 (patch)
tree281eae2418ab610fc66e22f7444d6e1a229cd44b /server/middlewares/validators
parent3afe0ec3b32d2bd9183541ecbf40278710f8707d (diff)
downloadPeerTube-8a6828b1664ce3fc535d23c54ed22bab35588d06.tar.gz
PeerTube-8a6828b1664ce3fc535d23c54ed22bab35588d06.tar.zst
PeerTube-8a6828b1664ce3fc535d23c54ed22bab35588d06.zip
Check channel sync id is owned by channel
Diffstat (limited to 'server/middlewares/validators')
-rw-r--r--server/middlewares/validators/videos/video-channels.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/server/middlewares/validators/videos/video-channels.ts b/server/middlewares/validators/videos/video-channels.ts
index 8338b24fc..ca6b57003 100644
--- a/server/middlewares/validators/videos/video-channels.ts
+++ b/server/middlewares/validators/videos/video-channels.ts
@@ -166,6 +166,13 @@ export const videoChannelImportVideosValidator = [
166 166
167 if (body.videoChannelSyncId && !await doesVideoChannelSyncIdExist(body.videoChannelSyncId, res)) return 167 if (body.videoChannelSyncId && !await doesVideoChannelSyncIdExist(body.videoChannelSyncId, res)) return
168 168
169 if (res.locals.videoChannelSync && res.locals.videoChannelSync.videoChannelId !== res.locals.videoChannel.id) {
170 return res.fail({
171 status: HttpStatusCode.FORBIDDEN_403,
172 message: 'This channel sync is not owned by this channel'
173 })
174 }
175
169 return next() 176 return next()
170 } 177 }
171] 178]