aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-04-03 21:24:36 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-04-03 21:24:36 +0200
commit1d49e1e27d63db1dfc9a7fd28c9902f488831a89 (patch)
treece3353ad691876c55ce8fcfdd70bfa2b9112b39a /server/helpers
parent31b59b477459d4f26ed8ef089a0e5553fb6a332b (diff)
downloadPeerTube-1d49e1e27d63db1dfc9a7fd28c9902f488831a89.tar.gz
PeerTube-1d49e1e27d63db1dfc9a7fd28c9902f488831a89.tar.zst
PeerTube-1d49e1e27d63db1dfc9a7fd28c9902f488831a89.zip
Server: Add NSFW in user profile
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