mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-29 01:33:10 -06:00
fail on passwords being 0 len again
This commit is contained in:
parent
c6984b2020
commit
b41704c5e3
|
|
@ -232,7 +232,7 @@ func validatePassword(password string, cfg config.PasswordRequirements) *util.JS
|
||||||
Code: http.StatusBadRequest,
|
Code: http.StatusBadRequest,
|
||||||
JSON: jsonerror.WeakPassword(fmt.Sprintf("'password' >%d characters", cfg.MaxPasswordLength)),
|
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{
|
return &util.JSONResponse{
|
||||||
Code: http.StatusBadRequest,
|
Code: http.StatusBadRequest,
|
||||||
JSON: jsonerror.WeakPassword(fmt.Sprintf("password too weak: min %d chars", cfg.MinPasswordLength)),
|
JSON: jsonerror.WeakPassword(fmt.Sprintf("password too weak: min %d chars", cfg.MinPasswordLength)),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue