Add restriction on max password length

This commit is contained in:
Girish Ramakrishnan
2019-02-08 09:47:36 -08:00
parent 19348ef205
commit 950a6d4c5d
2 changed files with 2 additions and 0 deletions

View File

@@ -130,6 +130,7 @@ function validatePassword(password) {
assert.strictEqual(typeof password, 'string');
if (password.length < 8) return new UsersError(UsersError.BAD_FIELD, 'Password must be atleast 8 characters');
if (password.length > 256) return new UsersError(UsersError.BAD_FIELD, 'Password cannot be more than 256 characters');
return null;
}