mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Validate password length when registering
This commit is contained in:
parent
cc962c3e6f
commit
e99165b475
1 changed files with 4 additions and 1 deletions
|
@ -20,10 +20,13 @@ module.exports = UserRegistrationHandler =
|
|||
hasZeroLength = true
|
||||
return hasZeroLength
|
||||
|
||||
isTooShort: (prop, length) ->
|
||||
return prop.length < length
|
||||
|
||||
_registrationRequestIsValid : (body, callback)->
|
||||
email = EmailHelper.parseEmail(body.email) or ''
|
||||
password = body.password
|
||||
if @hasZeroLengths([password, email])
|
||||
if @hasZeroLengths([password, email]) or @isTooShort(password, 6)
|
||||
return false
|
||||
else
|
||||
return true
|
||||
|
|
Loading…
Reference in a new issue