aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/users
diff options
context:
space:
mode:
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)