diff options
author | Chocobozzz <me@florianbigard.com> | 2021-08-27 10:15:55 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-08-27 10:15:55 +0200 |
commit | 8f581725651c4b2c213d75fc028e306bbf239d3e (patch) | |
tree | 8deb842327c2a227d8e302d9a84bd9f8f9f7affa /server/middlewares | |
parent | 1ff15061b31245df4248e47228d0a90b07ab3f01 (diff) | |
download | PeerTube-8f581725651c4b2c213d75fc028e306bbf239d3e.tar.gz PeerTube-8f581725651c4b2c213d75fc028e306bbf239d3e.tar.zst PeerTube-8f581725651c4b2c213d75fc028e306bbf239d3e.zip |
Allow accounts to skip account setup modal
Diffstat (limited to 'server/middlewares')
-rw-r--r-- | server/middlewares/validators/users.ts | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/server/middlewares/validators/users.ts b/server/middlewares/validators/users.ts index bc8607523..c6977fcd9 100644 --- a/server/middlewares/validators/users.ts +++ b/server/middlewares/validators/users.ts | |||
@@ -9,14 +9,13 @@ import { UserRegister } from '../../../shared/models/users/user-register.model' | |||
9 | import { toBooleanOrNull, toIntOrNull } from '../../helpers/custom-validators/misc' | 9 | import { toBooleanOrNull, toIntOrNull } from '../../helpers/custom-validators/misc' |
10 | import { isThemeNameValid } from '../../helpers/custom-validators/plugins' | 10 | import { isThemeNameValid } from '../../helpers/custom-validators/plugins' |
11 | import { | 11 | import { |
12 | isNoInstanceConfigWarningModal, | ||
13 | isNoWelcomeModal, | ||
14 | isUserAdminFlagsValid, | 12 | isUserAdminFlagsValid, |
15 | isUserAutoPlayNextVideoValid, | 13 | isUserAutoPlayNextVideoValid, |
16 | isUserAutoPlayVideoValid, | 14 | isUserAutoPlayVideoValid, |
17 | isUserBlockedReasonValid, | 15 | isUserBlockedReasonValid, |
18 | isUserDescriptionValid, | 16 | isUserDescriptionValid, |
19 | isUserDisplayNameValid, | 17 | isUserDisplayNameValid, |
18 | isUserNoModal, | ||
20 | isUserNSFWPolicyValid, | 19 | isUserNSFWPolicyValid, |
21 | isUserPasswordValid, | 20 | isUserPasswordValid, |
22 | isUserPasswordValidOrEmpty, | 21 | isUserPasswordValidOrEmpty, |
@@ -251,12 +250,17 @@ const usersUpdateMeValidator = [ | |||
251 | body('theme') | 250 | body('theme') |
252 | .optional() | 251 | .optional() |
253 | .custom(v => isThemeNameValid(v) && isThemeRegistered(v)).withMessage('Should have a valid theme'), | 252 | .custom(v => isThemeNameValid(v) && isThemeRegistered(v)).withMessage('Should have a valid theme'), |
253 | |||
254 | body('noInstanceConfigWarningModal') | 254 | body('noInstanceConfigWarningModal') |
255 | .optional() | 255 | .optional() |
256 | .custom(v => isNoInstanceConfigWarningModal(v)).withMessage('Should have a valid noInstanceConfigWarningModal boolean'), | 256 | .custom(v => isUserNoModal(v)).withMessage('Should have a valid noInstanceConfigWarningModal boolean'), |
257 | body('noWelcomeModal') | 257 | body('noWelcomeModal') |
258 | .optional() | 258 | .optional() |
259 | .custom(v => isNoWelcomeModal(v)).withMessage('Should have a valid noWelcomeModal boolean'), | 259 | .custom(v => isUserNoModal(v)).withMessage('Should have a valid noWelcomeModal boolean'), |
260 | body('noAccountSetupWarningModal') | ||
261 | .optional() | ||
262 | .custom(v => isUserNoModal(v)).withMessage('Should have a valid noAccountSetupWarningModal boolean'), | ||
263 | |||
260 | body('autoPlayNextVideo') | 264 | body('autoPlayNextVideo') |
261 | .optional() | 265 | .optional() |
262 | .custom(v => isUserAutoPlayNextVideoValid(v)).withMessage('Should have a valid autoPlayNextVideo boolean'), | 266 | .custom(v => isUserAutoPlayNextVideoValid(v)).withMessage('Should have a valid autoPlayNextVideo boolean'), |