Enforce password length check on reset request (#51005)

pull/51106/head
asymness 3 years ago committed by GitHub
parent 6ffac76520
commit 1f5f40b2da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      pkg/api/password.go

@ -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

Loading…
Cancel
Save