diff --git a/plugins/credential-password/constants.go b/plugins/credential-password/constants.go index 781290f..76331cc 100644 --- a/plugins/credential-password/constants.go +++ b/plugins/credential-password/constants.go @@ -4,6 +4,7 @@ import "github.com/thecodearcher/limen" const ( defaultMinPasswordLength = 8 + minAllowedPasswordLength = 4 defaultPasswordRequireUppercase = true defaultPasswordRequireNumbers = true defaultPasswordRequireSymbols = false diff --git a/plugins/credential-password/plugin.go b/plugins/credential-password/plugin.go index 50b3c92..f020e60 100644 --- a/plugins/credential-password/plugin.go +++ b/plugins/credential-password/plugin.go @@ -105,8 +105,8 @@ func (p *credentialPasswordPlugin) Initialize(core *limen.LimenCore) error { return fmt.Errorf("config is required") } - if p.config.passwordMinLength < defaultMinPasswordLength { - return fmt.Errorf("password min length must be at least 4") + if p.config.passwordMinLength < minAllowedPasswordLength { + return fmt.Errorf("password min length must be at least %d", minAllowedPasswordLength) } return nil