mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-31 12:51:35 +02:00
Validate password length when registering
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user