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) {
var displayName = typeof formData.displayName !== 'undefined' ? formData.displayName.toString().trim() : '';
return {
email: formData.email.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,
}
}

View File

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