diff options
Diffstat (limited to 'src/api/endpoints')
| -rw-r--r-- | src/api/endpoints/i/update.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/api/endpoints/i/update.js b/src/api/endpoints/i/update.js index fdb89644a7..4b4d1743da 100644 --- a/src/api/endpoints/i/update.js +++ b/src/api/endpoints/i/update.js @@ -5,7 +5,7 @@ */ import * as mongo from 'mongodb'; import User from '../../models/user'; -import { isValidBirthday } from '../../models/user'; +import { isValidName, isValidBirthday } from '../../models/user'; import serialize from '../../serializers/user'; import event from '../../event'; import config from '../../../conf'; @@ -25,8 +25,8 @@ module.exports = async (params, user, _, isSecure) => // Get 'name' parameter const name = params.name; if (name !== undefined && name !== null) { - if (name.length > 50) { - return rej('too long name'); + if (!isValidName(name)) { + return rej('invalid name'); } user.name = name; |