aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/users.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-07-23 10:40:39 +0200
committerChocobozzz <chocobozzz@cpy.re>2019-07-24 10:58:16 +0200
commit3e753302d8c911b59971c16a8018df0e1ab78465 (patch)
treeefce7ece3273589228c5c948ea6757b2bdf65429 /server/middlewares/validators/users.ts
parenta8b666e9f1ed002230869606308749614390c82f (diff)
downloadPeerTube-3e753302d8c911b59971c16a8018df0e1ab78465.tar.gz
PeerTube-3e753302d8c911b59971c16a8018df0e1ab78465.tar.zst
PeerTube-3e753302d8c911b59971c16a8018df0e1ab78465.zip
Refactor middleware helpers
Diffstat (limited to 'server/middlewares/validators/users.ts')
-rw-r--r--server/middlewares/validators/users.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/server/middlewares/validators/users.ts b/server/middlewares/validators/users.ts
index a507afc5b..7002de20d 100644
--- a/server/middlewares/validators/users.ts
+++ b/server/middlewares/validators/users.ts
@@ -13,12 +13,12 @@ import {
13 isUserNSFWPolicyValid, 13 isUserNSFWPolicyValid,
14 isUserPasswordValid, 14 isUserPasswordValid,
15 isUserRoleValid, 15 isUserRoleValid,
16 isUserUsernameValid, isUserVideoLanguages, 16 isUserUsernameValid,
17 isUserVideoLanguages,
17 isUserVideoQuotaDailyValid, 18 isUserVideoQuotaDailyValid,
18 isUserVideoQuotaValid, 19 isUserVideoQuotaValid,
19 isUserVideosHistoryEnabledValid 20 isUserVideosHistoryEnabledValid
20} from '../../helpers/custom-validators/users' 21} from '../../helpers/custom-validators/users'
21import { doesVideoExist } from '../../helpers/custom-validators/videos'
22import { logger } from '../../helpers/logger' 22import { logger } from '../../helpers/logger'
23import { isSignupAllowed, isSignupAllowedForCurrentIP } from '../../helpers/signup' 23import { isSignupAllowed, isSignupAllowedForCurrentIP } from '../../helpers/signup'
24import { Redis } from '../../lib/redis' 24import { Redis } from '../../lib/redis'
@@ -30,6 +30,7 @@ import { isVideoChannelNameValid } from '../../helpers/custom-validators/video-c
30import { UserRegister } from '../../../shared/models/users/user-register.model' 30import { UserRegister } from '../../../shared/models/users/user-register.model'
31import { isThemeNameValid } from '../../helpers/custom-validators/plugins' 31import { isThemeNameValid } from '../../helpers/custom-validators/plugins'
32import { isThemeRegistered } from '../../lib/plugins/theme-utils' 32import { isThemeRegistered } from '../../lib/plugins/theme-utils'
33import { doesVideoExist } from '../../helpers/middlewares'
33 34
34const usersAddValidator = [ 35const usersAddValidator = [
35 body('username').custom(isUserUsernameValid).withMessage('Should have a valid username (lowercase alphanumeric characters)'), 36 body('username').custom(isUserUsernameValid).withMessage('Should have a valid username (lowercase alphanumeric characters)'),