From 1333ab1f2d4ec495084c5368df25610683582ae3 Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Fri, 4 Jun 2021 09:16:23 +0200 Subject: add operationId doc middleware to so API endpoints --- server/controllers/api/users/token.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'server/controllers/api/users') 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 import { handleOAuthToken } from '@server/lib/auth/oauth' import { BypassLogin, revokeToken } from '@server/lib/auth/oauth-model' import { Hooks } from '@server/lib/plugins/hooks' -import { asyncMiddleware, authenticate } from '@server/middlewares' +import { asyncMiddleware, authenticate, openapiOperationDoc } from '@server/middlewares' import { ScopedToken } from '@shared/models/users/user-scoped-token' const tokensRouter = express.Router() @@ -19,10 +19,12 @@ const loginRateLimiter = RateLimit({ tokensRouter.post('/token', loginRateLimiter, + openapiOperationDoc({ operationId: 'getOAuthToken' }), asyncMiddleware(handleToken) ) tokensRouter.post('/revoke-token', + openapiOperationDoc({ operationId: 'revokeOAuthToken' }), authenticate, asyncMiddleware(handleTokenRevocation) ) -- cgit v1.2.3