1
0
Fork 0
mirror of https://gitlab.com/Alamantus/Readlebee.git synced 2025-05-08 19:21:15 +02:00

Fix display name requirements

This commit is contained in:
Robbie Antenesse 2019-10-26 11:47:15 -06:00
parent 5aeee0bc01
commit 24b36045ff
2 changed files with 3 additions and 2 deletions

View file

@ -69,10 +69,11 @@ class Account {
} }
static cleanCreateAccountFormData (formData) { static cleanCreateAccountFormData (formData) {
var displayName = typeof formData.displayName !== 'undefined' ? formData.displayName.toString().trim() : '';
return { return {
email: formData.email.trim(), email: formData.email.trim(),
username: formData.username.toString().trim(), username: formData.username.toString().trim(),
displayName: typeof formData.displayName !== 'undefined' ? formData.displayName.toString().trim() : 'A Bee', displayName: displayName.length > 0 ? displayName : 'A Bee',
password: formData.password, password: formData.password,
} }
} }

View file

@ -30,7 +30,7 @@ function getSequelizeModels (sequelize) {
allowNull: false, allowNull: false,
unique: true, unique: true,
validate: { validate: {
len: [2, 32], len: [1, 32],
}, },
}, },
passwordHash: { passwordHash: {