aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/v1/users.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-03-21 11:56:33 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-03-21 11:56:33 +0100
commit9457bf88079a23d28011ff7c65faa56a548b7817 (patch)
treef4507aa5ad04b7fca4ab49acee5aa97c6c962f6c /server/controllers/api/v1/users.js
parent233d12d8b1916eae5bae230dc965045adb89a173 (diff)
downloadPeerTube-9457bf88079a23d28011ff7c65faa56a548b7817.tar.gz
PeerTube-9457bf88079a23d28011ff7c65faa56a548b7817.tar.zst
PeerTube-9457bf88079a23d28011ff7c65faa56a548b7817.zip
OAuth server: first draft
Diffstat (limited to 'server/controllers/api/v1/users.js')
-rw-r--r--server/controllers/api/v1/users.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/server/controllers/api/v1/users.js b/server/controllers/api/v1/users.js
new file mode 100644
index 000000000..acb860c66
--- /dev/null
+++ b/server/controllers/api/v1/users.js
@@ -0,0 +1,22 @@
1'use strict'
2
3var express = require('express')
4var oAuth2 = require('../../../middlewares/oauth2')
5
6const middleware = require('../../../middlewares')
7const cacheMiddleware = middleware.cache
8
9const router = express.Router()
10
11router.post('/token', cacheMiddleware.cache(false), oAuth2.token(), success)
12router.get('/authenticate', cacheMiddleware.cache(false), oAuth2.authenticate(), success)
13
14// ---------------------------------------------------------------------------
15
16module.exports = router
17
18// ---------------------------------------------------------------------------
19
20function success (req, res, next) {
21 res.end()
22}