diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-05-13 16:31:14 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-05-13 16:31:14 +0200 |
commit | b3b926474204ad736ec434aafc8afc6bc55079f6 (patch) | |
tree | ba235886357a8c032fea7ef17cd9ab9519ea6a2b /server/controllers/api/v1/pods.js | |
parent | 5dda52c924763a889e98b4cf97c588b34ef01812 (diff) | |
download | PeerTube-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.js | 13 |
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 | ||
5 | const logger = require('../../../helpers/logger') | 5 | const logger = require('../../../helpers/logger') |
6 | const friends = require('../../../lib/friends') | 6 | const friends = require('../../../lib/friends') |
7 | const middleware = require('../../../middlewares') | 7 | const middlewares = require('../../../middlewares') |
8 | const Pods = require('../../../models/pods') | 8 | const Pods = require('../../../models/pods') |
9 | const reqValidator = middleware.reqValidators.pods | 9 | const oAuth2 = middlewares.oauth2 |
10 | const secureMiddleware = middleware.secure | 10 | const reqValidator = middlewares.reqValidators.pods |
11 | const secureRequest = middleware.reqValidators.remote.secureRequest | 11 | const secureMiddleware = middlewares.secure |
12 | const secureRequest = middlewares.reqValidators.remote.secureRequest | ||
12 | const videos = require('../../../lib/videos') | 13 | const videos = require('../../../lib/videos') |
13 | const Videos = require('../../../models/videos') | 14 | const Videos = require('../../../models/videos') |
14 | 15 | ||
@@ -16,8 +17,8 @@ const router = express.Router() | |||
16 | 17 | ||
17 | router.get('/', listPods) | 18 | router.get('/', listPods) |
18 | router.post('/', reqValidator.podsAdd, addPods) | 19 | router.post('/', reqValidator.podsAdd, addPods) |
19 | router.get('/makefriends', reqValidator.makeFriends, makeFriends) | 20 | router.get('/makefriends', oAuth2.authenticate, reqValidator.makeFriends, makeFriends) |
20 | router.get('/quitfriends', quitFriends) | 21 | router.get('/quitfriends', oAuth2.authenticate, quitFriends) |
21 | // Post because this is a secured request | 22 | // Post because this is a secured request |
22 | router.post('/remove', secureRequest, secureMiddleware.decryptBody, removePods) | 23 | router.post('/remove', secureRequest, secureMiddleware.decryptBody, removePods) |
23 | 24 | ||