mirror of
				https://gitlab.com/Alamantus/Readlebee.git
				synced 2025-11-04 10:17:03 +01: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) {
 | 
			
		||||
    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,
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -30,7 +30,7 @@ function getSequelizeModels (sequelize) {
 | 
			
		|||
      allowNull: false,
 | 
			
		||||
      unique: true,
 | 
			
		||||
      validate: {
 | 
			
		||||
        len: [2, 32],
 | 
			
		||||
        len: [1, 32],
 | 
			
		||||
      },
 | 
			
		||||
    },
 | 
			
		||||
    passwordHash: {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue