aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/v1/pods.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-05-13 16:31:14 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-05-13 16:31:14 +0200
commitb3b926474204ad736ec434aafc8afc6bc55079f6 (patch)
treeba235886357a8c032fea7ef17cd9ab9519ea6a2b /server/controllers/api/v1/pods.js
parent5dda52c924763a889e98b4cf97c588b34ef01812 (diff)
downloadPeerTube-b3b926474204ad736ec434aafc8afc6bc55079f6.tar.gz
PeerTube-b3b926474204ad736ec434aafc8afc6bc55079f6.tar.zst
PeerTube-b3b926474204ad736ec434aafc8afc6bc55079f6.zip
Authenticate before make/quit friends (server + tests)
Diffstat (limited to 'server/controllers/api/v1/pods.js')
-rw-r--r--server/controllers/api/v1/pods.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/server/controllers/api/v1/pods.js b/server/controllers/api/v1/pods.js
index fd13034a2..cec51f272 100644
--- a/server/controllers/api/v1/pods.js
+++ b/server/controllers/api/v1/pods.js
@@ -4,11 +4,12 @@ const express = require('express')
4 4
5const logger = require('../../../helpers/logger') 5const logger = require('../../../helpers/logger')
6const friends = require('../../../lib/friends') 6const friends = require('../../../lib/friends')
7const middleware = require('../../../middlewares') 7const middlewares = require('../../../middlewares')
8const Pods = require('../../../models/pods') 8const Pods = require('../../../models/pods')
9const reqValidator = middleware.reqValidators.pods 9const oAuth2 = middlewares.oauth2
10const secureMiddleware = middleware.secure 10const reqValidator = middlewares.reqValidators.pods
11const secureRequest = middleware.reqValidators.remote.secureRequest 11const secureMiddleware = middlewares.secure
12const secureRequest = middlewares.reqValidators.remote.secureRequest
12const videos = require('../../../lib/videos') 13const videos = require('../../../lib/videos')
13const Videos = require('../../../models/videos') 14const Videos = require('../../../models/videos')
14 15
@@ -16,8 +17,8 @@ const router = express.Router()
16 17
17router.get('/', listPods) 18router.get('/', listPods)
18router.post('/', reqValidator.podsAdd, addPods) 19router.post('/', reqValidator.podsAdd, addPods)
19router.get('/makefriends', reqValidator.makeFriends, makeFriends) 20router.get('/makefriends', oAuth2.authenticate, reqValidator.makeFriends, makeFriends)
20router.get('/quitfriends', quitFriends) 21router.get('/quitfriends', oAuth2.authenticate, quitFriends)
21// Post because this is a secured request 22// Post because this is a secured request
22router.post('/remove', secureRequest, secureMiddleware.decryptBody, removePods) 23router.post('/remove', secureRequest, secureMiddleware.decryptBody, removePods)
23 24