diff options
Diffstat (limited to 'server/controllers/api/v1/users.js')
-rw-r--r-- | server/controllers/api/v1/users.js | 22 |
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 | |||
3 | var express = require('express') | ||
4 | var oAuth2 = require('../../../middlewares/oauth2') | ||
5 | |||
6 | const middleware = require('../../../middlewares') | ||
7 | const cacheMiddleware = middleware.cache | ||
8 | |||
9 | const router = express.Router() | ||
10 | |||
11 | router.post('/token', cacheMiddleware.cache(false), oAuth2.token(), success) | ||
12 | router.get('/authenticate', cacheMiddleware.cache(false), oAuth2.authenticate(), success) | ||
13 | |||
14 | // --------------------------------------------------------------------------- | ||
15 | |||
16 | module.exports = router | ||
17 | |||
18 | // --------------------------------------------------------------------------- | ||
19 | |||
20 | function success (req, res, next) { | ||
21 | res.end() | ||
22 | } | ||