From b41704c5e3332ad32286a969b7f405ab52dbdc4d Mon Sep 17 00:00:00 2001 From: Devon Mizelle Date: Wed, 29 Sep 2021 19:58:43 -0400 Subject: [PATCH] fail on passwords being 0 len again --- clientapi/routing/register.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clientapi/routing/register.go b/clientapi/routing/register.go index eb7333819..f3b1e8b54 100644 --- a/clientapi/routing/register.go +++ b/clientapi/routing/register.go @@ -232,7 +232,7 @@ func validatePassword(password string, cfg config.PasswordRequirements) *util.JS Code: http.StatusBadRequest, JSON: jsonerror.WeakPassword(fmt.Sprintf("'password' >%d characters", cfg.MaxPasswordLength)), } - } else if len(password) > 0 && len(password) < cfg.MinPasswordLength { + } else if len(password) < cfg.MinPasswordLength { return &util.JSONResponse{ Code: http.StatusBadRequest, JSON: jsonerror.WeakPassword(fmt.Sprintf("password too weak: min %d chars", cfg.MinPasswordLength)),