Skip to content

Commit

Permalink
feat(server): enforce password 8-128 characters long
Browse files Browse the repository at this point in the history
  • Loading branch information
Awk34 committed Dec 8, 2016
1 parent 579e773 commit cd30bf3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ UserSchema
if(authTypes.indexOf(this.provider) !== -1) {
return true;
}<% } %>
return password.length;
return password.length >= 8 && password.length <= 128;
}, 'Password cannot be blank');

// Validate email is not taken
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ export default function(sequelize, DataTypes) {
password: {
type: DataTypes.STRING,
validate: {
notEmpty: true
notEmpty: true,
min: 8,
max: 128,
}
},
provider: DataTypes.STRING,
Expand Down

0 comments on commit cd30bf3

Please sign in to comment.