diff options
Diffstat (limited to 'server/helpers/custom-validators/users.js')
-rw-r--r-- | server/helpers/custom-validators/users.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/server/helpers/custom-validators/users.js b/server/helpers/custom-validators/users.js index 88fa1592e..2fc026e98 100644 --- a/server/helpers/custom-validators/users.js +++ b/server/helpers/custom-validators/users.js | |||
@@ -9,7 +9,8 @@ const USERS_CONSTRAINTS_FIELDS = constants.CONSTRAINTS_FIELDS.USERS | |||
9 | const usersValidators = { | 9 | const usersValidators = { |
10 | isUserPasswordValid, | 10 | isUserPasswordValid, |
11 | isUserRoleValid, | 11 | isUserRoleValid, |
12 | isUserUsernameValid | 12 | isUserUsernameValid, |
13 | isUserDisplayNSFWValid | ||
13 | } | 14 | } |
14 | 15 | ||
15 | function isUserPasswordValid (value) { | 16 | function isUserPasswordValid (value) { |
@@ -26,6 +27,10 @@ function isUserUsernameValid (value) { | |||
26 | return validator.matches(value, new RegExp(`^[a-zA-Z0-9._]{${min},${max}}$`)) | 27 | return validator.matches(value, new RegExp(`^[a-zA-Z0-9._]{${min},${max}}$`)) |
27 | } | 28 | } |
28 | 29 | ||
30 | function isUserDisplayNSFWValid (value) { | ||
31 | return validator.isBoolean(value) | ||
32 | } | ||
33 | |||
29 | // --------------------------------------------------------------------------- | 34 | // --------------------------------------------------------------------------- |
30 | 35 | ||
31 | module.exports = usersValidators | 36 | module.exports = usersValidators |