mirror of
https://gitlab.com/Alamantus/Readlebee.git
synced 2025-05-08 11:11:15 +02:00
Fix display name requirements
This commit is contained in:
parent
5aeee0bc01
commit
24b36045ff
2 changed files with 3 additions and 2 deletions
|
@ -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,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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: {
|
||||||
|
|
Loading…
Add table
Reference in a new issue