aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/v1/pods.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api/v1/pods.js')
-rw-r--r--server/controllers/api/v1/pods.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/server/controllers/api/v1/pods.js b/server/controllers/api/v1/pods.js
index 2bc761fef..f61f2a483 100644
--- a/server/controllers/api/v1/pods.js
+++ b/server/controllers/api/v1/pods.js
@@ -8,6 +8,7 @@ const waterfall = require('async/waterfall')
8const logger = require('../../../helpers/logger') 8const logger = require('../../../helpers/logger')
9const friends = require('../../../lib/friends') 9const friends = require('../../../lib/friends')
10const middlewares = require('../../../middlewares') 10const middlewares = require('../../../middlewares')
11const admin = middlewares.admin
11const oAuth = middlewares.oauth 12const oAuth = middlewares.oauth
12const validators = middlewares.validators.pods 13const validators = middlewares.validators.pods
13const signatureValidator = middlewares.validators.remote.signature 14const signatureValidator = middlewares.validators.remote.signature
@@ -18,8 +19,17 @@ const Video = mongoose.model('Video')
18 19
19router.get('/', listPodsUrl) 20router.get('/', listPodsUrl)
20router.post('/', validators.podsAdd, addPods) 21router.post('/', validators.podsAdd, addPods)
21router.get('/makefriends', oAuth.authenticate, validators.makeFriends, makeFriends) 22router.get('/makefriends',
22router.get('/quitfriends', oAuth.authenticate, quitFriends) 23 oAuth.authenticate,
24 admin.ensureIsAdmin,
25 validators.makeFriends,
26 makeFriends
27)
28router.get('/quitfriends',
29 oAuth.authenticate,
30 admin.ensureIsAdmin,
31 quitFriends
32)
23// Post because this is a secured request 33// Post because this is a secured request
24router.post('/remove', signatureValidator, removePods) 34router.post('/remove', signatureValidator, removePods)
25 35