diff options
Diffstat (limited to 'server/controllers/api')
-rw-r--r-- | server/controllers/api/users/index.ts | 14 |
1 files changed, 12 insertions, 2 deletions
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 { | |||
17 | paginationValidator, | 17 | paginationValidator, |
18 | setDefaultPagination, | 18 | setDefaultPagination, |
19 | setDefaultSort, | 19 | setDefaultSort, |
20 | token, | ||
21 | userAutocompleteValidator, | 20 | userAutocompleteValidator, |
22 | usersAddValidator, | 21 | usersAddValidator, |
23 | usersGetValidator, | 22 | usersGetValidator, |
@@ -50,6 +49,7 @@ import { UserAdminFlag } from '../../../../shared/models/users/user-flag.model' | |||
50 | import { UserRegister } from '../../../../shared/models/users/user-register.model' | 49 | import { UserRegister } from '../../../../shared/models/users/user-register.model' |
51 | import { MUser, MUserAccountDefault } from '@server/typings/models' | 50 | import { MUser, MUserAccountDefault } from '@server/typings/models' |
52 | import { Hooks } from '@server/lib/plugins/hooks' | 51 | import { Hooks } from '@server/lib/plugins/hooks' |
52 | import { handleIdAndPassLogin } from '@server/lib/auth' | ||
53 | 53 | ||
54 | const auditLogger = auditLoggerFactory('users') | 54 | const auditLogger = auditLoggerFactory('users') |
55 | 55 | ||
@@ -170,7 +170,17 @@ usersRouter.post('/:id/verify-email', | |||
170 | 170 | ||
171 | usersRouter.post('/token', | 171 | usersRouter.post('/token', |
172 | loginRateLimiter, | 172 | loginRateLimiter, |
173 | token, | 173 | handleIdAndPassLogin, |
174 | tokenSuccess | ||
175 | ) | ||
176 | usersRouter.post('/token', | ||
177 | loginRateLimiter, | ||
178 | handleIdAndPassLogin, | ||
179 | tokenSuccess | ||
180 | ) | ||
181 | usersRouter.post('/revoke-token', | ||
182 | loginRateLimiter, | ||
183 | handleIdAndPassLogin, | ||
174 | tokenSuccess | 184 | tokenSuccess |
175 | ) | 185 | ) |
176 | // TODO: Once https://github.com/oauthjs/node-oauth2-server/pull/289 is merged, implement revoke token route | 186 | // TODO: Once https://github.com/oauthjs/node-oauth2-server/pull/289 is merged, implement revoke token route |