diff options
Diffstat (limited to 'server/controllers/api')
-rw-r--r-- | server/controllers/api/users/two-factor.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/controllers/api/users/two-factor.ts b/server/controllers/api/users/two-factor.ts index 1725294e7..79f63a62d 100644 --- a/server/controllers/api/users/two-factor.ts +++ b/server/controllers/api/users/two-factor.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import express from 'express' | 1 | import express from 'express' |
2 | import { generateOTPSecret, isOTPValid } from '@server/helpers/otp' | 2 | import { generateOTPSecret, isOTPValid } from '@server/helpers/otp' |
3 | import { Redis } from '@server/lib/redis' | 3 | import { Redis } from '@server/lib/redis' |
4 | import { asyncMiddleware, authenticate, usersCheckCurrentPassword } from '@server/middlewares' | 4 | import { asyncMiddleware, authenticate, usersCheckCurrentPasswordFactory } from '@server/middlewares' |
5 | import { | 5 | import { |
6 | confirmTwoFactorValidator, | 6 | confirmTwoFactorValidator, |
7 | disableTwoFactorValidator, | 7 | disableTwoFactorValidator, |
@@ -13,7 +13,7 @@ const twoFactorRouter = express.Router() | |||
13 | 13 | ||
14 | twoFactorRouter.post('/:id/two-factor/request', | 14 | twoFactorRouter.post('/:id/two-factor/request', |
15 | authenticate, | 15 | authenticate, |
16 | asyncMiddleware(usersCheckCurrentPassword), | 16 | asyncMiddleware(usersCheckCurrentPasswordFactory(req => req.params.id)), |
17 | asyncMiddleware(requestOrConfirmTwoFactorValidator), | 17 | asyncMiddleware(requestOrConfirmTwoFactorValidator), |
18 | asyncMiddleware(requestTwoFactor) | 18 | asyncMiddleware(requestTwoFactor) |
19 | ) | 19 | ) |
@@ -27,7 +27,7 @@ twoFactorRouter.post('/:id/two-factor/confirm-request', | |||
27 | 27 | ||
28 | twoFactorRouter.post('/:id/two-factor/disable', | 28 | twoFactorRouter.post('/:id/two-factor/disable', |
29 | authenticate, | 29 | authenticate, |
30 | asyncMiddleware(usersCheckCurrentPassword), | 30 | asyncMiddleware(usersCheckCurrentPasswordFactory(req => req.params.id)), |
31 | asyncMiddleware(disableTwoFactorValidator), | 31 | asyncMiddleware(disableTwoFactorValidator), |
32 | asyncMiddleware(disableTwoFactor) | 32 | asyncMiddleware(disableTwoFactor) |
33 | ) | 33 | ) |