Enforce password length check on reset request (#51005)

This commit is contained in:
asymness
2022-06-20 09:16:42 +02:00
committed by GitHub
parent 6ffac76520
commit 1f5f40b2da
+5
View File
@@ -64,6 +64,11 @@ func (hs *HTTPServer) ResetPassword(c *models.ReqContext) response.Response {
return response.Error(400, "Passwords do not match", nil)
}
password := models.Password(form.NewPassword)
if password.IsWeak() {
return response.Error(400, "New password is too short", nil)
}
cmd := models.ChangeUserPasswordCommand{}
cmd.UserId = query.Result.Id
var err error