From cd8eed812106c77d5679fca9e7e0eab70430af4b Mon Sep 17 00:00:00 2001 From: Sayem Chowdhury Date: Wed, 12 Aug 2026 13:59:23 +0600 Subject: [PATCH] fix(credential-password): allow password min length below default 8 --- plugins/credential-password/constants.go | 1 + plugins/credential-password/plugin.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) 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