St. Thomas Aquinas
“The power of this sacrament can be considered in two ways. First of all, in itself: and thus this sacrament has from Christ’s Passion the power of forgiving all sins, since the Passion is the fount and cause of the forgiveness of sins. Secondly, it can be considered in comparison with the recipient of the sacrament, in so far as there is, or is not, found in him an obstacle to receiving the fruit of this sacrament… as is said in the book De Eccles. Dogm.: ‘If the soul leans towards sin, it is burdened rather than purified from partaking of the Eucharist.'”
Source: St. Thomas Aquinas, Summa Theologica