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/two-factor.ts6
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 @@
1import express from 'express' 1import express from 'express'
2import { generateOTPSecret, isOTPValid } from '@server/helpers/otp' 2import { generateOTPSecret, isOTPValid } from '@server/helpers/otp'
3import { Redis } from '@server/lib/redis' 3import { Redis } from '@server/lib/redis'
4import { asyncMiddleware, authenticate, usersCheckCurrentPassword } from '@server/middlewares' 4import { asyncMiddleware, authenticate, usersCheckCurrentPasswordFactory } from '@server/middlewares'
5import { 5import {
6 confirmTwoFactorValidator, 6 confirmTwoFactorValidator,
7 disableTwoFactorValidator, 7 disableTwoFactorValidator,
@@ -13,7 +13,7 @@ const twoFactorRouter = express.Router()
13 13
14twoFactorRouter.post('/:id/two-factor/request', 14twoFactorRouter.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
28twoFactorRouter.post('/:id/two-factor/disable', 28twoFactorRouter.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)