aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers')
-rw-r--r--server/helpers/custom-validators/users.js7
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
9const usersValidators = { 9const usersValidators = {
10 isUserPasswordValid, 10 isUserPasswordValid,
11 isUserRoleValid, 11 isUserRoleValid,
12 isUserUsernameValid 12 isUserUsernameValid,
13 isUserDisplayNSFWValid
13} 14}
14 15
15function isUserPasswordValid (value) { 16function 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
30function isUserDisplayNSFWValid (value) {
31 return validator.isBoolean(value)
32}
33
29// --------------------------------------------------------------------------- 34// ---------------------------------------------------------------------------
30 35
31module.exports = usersValidators 36module.exports = usersValidators