aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares')
-rw-r--r--server/middlewares/validators/user-subscriptions.ts8
-rw-r--r--server/middlewares/validators/videos.ts2
2 files changed, 5 insertions, 5 deletions
diff --git a/server/middlewares/validators/user-subscriptions.ts b/server/middlewares/validators/user-subscriptions.ts
index f331b6c34..d8c26c742 100644
--- a/server/middlewares/validators/user-subscriptions.ts
+++ b/server/middlewares/validators/user-subscriptions.ts
@@ -20,11 +20,11 @@ const userSubscriptionAddValidator = [
20 } 20 }
21] 21]
22 22
23const userSubscriptionRemoveValidator = [ 23const userSubscriptionGetValidator = [
24 param('uri').custom(isValidActorHandle).withMessage('Should have a valid URI to unfollow'), 24 param('uri').custom(isValidActorHandle).withMessage('Should have a valid URI to unfollow'),
25 25
26 async (req: express.Request, res: express.Response, next: express.NextFunction) => { 26 async (req: express.Request, res: express.Response, next: express.NextFunction) => {
27 logger.debug('Checking unfollow parameters', { parameters: req.params }) 27 logger.debug('Checking userSubscriptionGetValidator parameters', { parameters: req.params })
28 28
29 if (areValidationErrors(req, res)) return 29 if (areValidationErrors(req, res)) return
30 30
@@ -34,7 +34,7 @@ const userSubscriptionRemoveValidator = [
34 const user: UserModel = res.locals.oauth.token.User 34 const user: UserModel = res.locals.oauth.token.User
35 const subscription = await ActorFollowModel.loadByActorAndTargetNameAndHost(user.Account.Actor.id, name, host) 35 const subscription = await ActorFollowModel.loadByActorAndTargetNameAndHost(user.Account.Actor.id, name, host)
36 36
37 if (!subscription) { 37 if (!subscription || !subscription.ActorFollowing.VideoChannel) {
38 return res 38 return res
39 .status(404) 39 .status(404)
40 .json({ 40 .json({
@@ -52,7 +52,7 @@ const userSubscriptionRemoveValidator = [
52 52
53export { 53export {
54 userSubscriptionAddValidator, 54 userSubscriptionAddValidator,
55 userSubscriptionRemoveValidator 55 userSubscriptionGetValidator
56} 56}
57 57
58// --------------------------------------------------------------------------- 58// ---------------------------------------------------------------------------
diff --git a/server/middlewares/validators/videos.ts b/server/middlewares/validators/videos.ts
index 53c32abb8..a2c866152 100644
--- a/server/middlewares/validators/videos.ts
+++ b/server/middlewares/validators/videos.ts
@@ -137,7 +137,7 @@ const videosGetValidator = [
137 137
138 // Video private or blacklisted 138 // Video private or blacklisted
139 if (video.privacy === VideoPrivacy.PRIVATE || video.VideoBlacklist) { 139 if (video.privacy === VideoPrivacy.PRIVATE || video.VideoBlacklist) {
140 authenticate(req, res, () => { 140 return authenticate(req, res, () => {
141 const user: UserModel = res.locals.oauth.token.User 141 const user: UserModel = res.locals.oauth.token.User
142 142
143 // Only the owner or a user that have blacklist rights can see the video 143 // Only the owner or a user that have blacklist rights can see the video