aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/users
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2021-06-04 09:16:23 +0200
committerRigel Kent <sendmemail@rigelk.eu>2021-06-04 09:21:46 +0200
commit1333ab1f2d4ec495084c5368df25610683582ae3 (patch)
tree4d2b6f5b36d2acfacd5e5f6c3a9d35a9c7101658 /server/controllers/api/users
parent1c627fd8d2e60d4d790353886006485343d70084 (diff)
downloadPeerTube-1333ab1f2d4ec495084c5368df25610683582ae3.tar.gz
PeerTube-1333ab1f2d4ec495084c5368df25610683582ae3.tar.zst
PeerTube-1333ab1f2d4ec495084c5368df25610683582ae3.zip
add operationId doc middleware to so API endpoints
Diffstat (limited to 'server/controllers/api/users')
-rw-r--r--server/controllers/api/users/token.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/server/controllers/api/users/token.ts b/server/controllers/api/users/token.ts
index 863a3d74c..e636f44f6 100644
--- a/server/controllers/api/users/token.ts
+++ b/server/controllers/api/users/token.ts
@@ -7,7 +7,7 @@ import { getAuthNameFromRefreshGrant, getBypassFromExternalAuth, getBypassFromPa
7import { handleOAuthToken } from '@server/lib/auth/oauth' 7import { handleOAuthToken } from '@server/lib/auth/oauth'
8import { BypassLogin, revokeToken } from '@server/lib/auth/oauth-model' 8import { BypassLogin, revokeToken } from '@server/lib/auth/oauth-model'
9import { Hooks } from '@server/lib/plugins/hooks' 9import { Hooks } from '@server/lib/plugins/hooks'
10import { asyncMiddleware, authenticate } from '@server/middlewares' 10import { asyncMiddleware, authenticate, openapiOperationDoc } from '@server/middlewares'
11import { ScopedToken } from '@shared/models/users/user-scoped-token' 11import { ScopedToken } from '@shared/models/users/user-scoped-token'
12 12
13const tokensRouter = express.Router() 13const tokensRouter = express.Router()
@@ -19,10 +19,12 @@ const loginRateLimiter = RateLimit({
19 19
20tokensRouter.post('/token', 20tokensRouter.post('/token',
21 loginRateLimiter, 21 loginRateLimiter,
22 openapiOperationDoc({ operationId: 'getOAuthToken' }),
22 asyncMiddleware(handleToken) 23 asyncMiddleware(handleToken)
23) 24)
24 25
25tokensRouter.post('/revoke-token', 26tokensRouter.post('/revoke-token',
27 openapiOperationDoc({ operationId: 'revokeOAuthToken' }),
26 authenticate, 28 authenticate,
27 asyncMiddleware(handleTokenRevocation) 29 asyncMiddleware(handleTokenRevocation)
28) 30)