diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-04-14 22:06:11 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-04-14 22:06:11 +0200 |
commit | 0c1cbbfe29d91c95f9c574b57adf067654b8b5b4 (patch) | |
tree | b61e48caedea8881cbfd1159295f6c311b35be90 /server/controllers/api/v1/users.js | |
parent | c9bf7d30bd688e84b12dca03029dde6e9645a997 (diff) | |
download | PeerTube-0c1cbbfe29d91c95f9c574b57adf067654b8b5b4.tar.gz PeerTube-0c1cbbfe29d91c95f9c574b57adf067654b8b5b4.tar.zst PeerTube-0c1cbbfe29d91c95f9c574b57adf067654b8b5b4.zip |
Add authentications for routes that need it and adapts the tests
Diffstat (limited to 'server/controllers/api/v1/users.js')
-rw-r--r-- | server/controllers/api/v1/users.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/server/controllers/api/v1/users.js b/server/controllers/api/v1/users.js index acb860c66..f45b47077 100644 --- a/server/controllers/api/v1/users.js +++ b/server/controllers/api/v1/users.js | |||
@@ -1,15 +1,14 @@ | |||
1 | 'use strict' | 1 | 'use strict' |
2 | 2 | ||
3 | var express = require('express') | 3 | const express = require('express') |
4 | var oAuth2 = require('../../../middlewares/oauth2') | 4 | const oAuth2 = require('../../../middlewares/oauth2') |
5 | 5 | ||
6 | const middleware = require('../../../middlewares') | 6 | const middleware = require('../../../middlewares') |
7 | const cacheMiddleware = middleware.cache | 7 | const cacheMiddleware = middleware.cache |
8 | 8 | ||
9 | const router = express.Router() | 9 | const router = express.Router() |
10 | 10 | ||
11 | router.post('/token', cacheMiddleware.cache(false), oAuth2.token(), success) | 11 | router.post('/token', cacheMiddleware.cache(false), oAuth2.token, success) |
12 | router.get('/authenticate', cacheMiddleware.cache(false), oAuth2.authenticate(), success) | ||
13 | 12 | ||
14 | // --------------------------------------------------------------------------- | 13 | // --------------------------------------------------------------------------- |
15 | 14 | ||