Thomas Aquinas,
Summa Theologiae — Question 79 - OF THE EFFECTS OF THIS SACRAMENT…
“ Nevertheless this sacrament can effect the forgiveness of sin in two ways. First of all, by being received, not actually, but in desire; as when a man is first justified from sin. Secondly, when received by one in mortal sin of which he is not conscious, and for which he has no attachment; since possibly he was not sufficiently contrite at first, but by approaching this sacrament devoutly and reverently he obtains the grace of charity, which will perfect his contrition and bring forgiveness of sin. ”
