From 7fed637506043e4432cbebe041ada0625171cceb Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 22 Apr 2020 16:07:04 +0200 Subject: Begin auth plugin support --- server/controllers/api/users/index.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'server/controllers') diff --git a/server/controllers/api/users/index.ts b/server/controllers/api/users/index.ts index 98eb2beed..b30f42b43 100644 --- a/server/controllers/api/users/index.ts +++ b/server/controllers/api/users/index.ts @@ -17,7 +17,6 @@ import { paginationValidator, setDefaultPagination, setDefaultSort, - token, userAutocompleteValidator, usersAddValidator, usersGetValidator, @@ -50,6 +49,7 @@ import { UserAdminFlag } from '../../../../shared/models/users/user-flag.model' import { UserRegister } from '../../../../shared/models/users/user-register.model' import { MUser, MUserAccountDefault } from '@server/typings/models' import { Hooks } from '@server/lib/plugins/hooks' +import { handleIdAndPassLogin } from '@server/lib/auth' const auditLogger = auditLoggerFactory('users') @@ -170,7 +170,17 @@ usersRouter.post('/:id/verify-email', usersRouter.post('/token', loginRateLimiter, - token, + handleIdAndPassLogin, + tokenSuccess +) +usersRouter.post('/token', + loginRateLimiter, + handleIdAndPassLogin, + tokenSuccess +) +usersRouter.post('/revoke-token', + loginRateLimiter, + handleIdAndPassLogin, tokenSuccess ) // TODO: Once https://github.com/oauthjs/node-oauth2-server/pull/289 is merged, implement revoke token route -- cgit v1.2.3