St. Thomas Aquinas has this to say:
On the contrary Augustine says (Super Joan., Tract. v): “Those who were baptized with John’s baptism needed to be baptized with the baptism of our Lord.”
I answer that According to the opinion of the Master (Sent. iv, D, 2), "those who had been baptized by John without knowing of the existence of the Holy Ghost, and who based their hopes on his baptism, were afterwards baptized with the baptism of Christ: but those who did not base their hope on John’s baptism, and who believed in the Father, Son, and Holy Ghost, were not baptized afterwards, but received the Holy Ghost by the imposition of hands made over them by the apostles."And this, indeed, is true as to the first part, and is confirmed by many authorities. But as to the second part, the assertion is altogether unreasonable. First, because John’s baptism neither conferred grace nor imprinted a character, but was merely “in water,” as he says himself (Mt 3,11). Wherefore the faith or hope which the person baptized had in Christ could not supply this defect. Secondly, because, when in a sacrament, that is omitted which belongs of necessity to the sacrament, not only must the omission be supplied, but the whole must be entirely renewed. Now, it belongs of necessity to Christ’s baptism that it be given not only in water, but also in the Holy Ghost, according to Jn. 3:5: “Unless a man be born of water and the Holy Ghost, he cannot enter into the kingdom of God.” Wherefore in the case of those who had been baptized with John’s baptism in water only, not merely had the omission to be supplied by giving them the Holy Ghost by the imposition of hands, but they had to be baptized wholly anew “in water and the Holy Ghost.”
Reply to Objection: 1. As Augustine says (Super Joan., Tract. v): “After John, baptism was administered, and the reason why was because he gave not Christ’s baptism, but his own . . . That which Peter gave . . . and if any were given by Judas, that was Christ’s. And therefore if Judas baptized anyone, yet were they not rebaptized . . . For the baptism corresponds with him by whose authority it is given, not with him by whose ministry it is given.” For the same reason those who were baptized by the deacon Philip, who gave the baptism of Christ, were not baptized again, but received the imposition of hands by the apostles, just as those who are baptized by priests are confirmed by bishops. (Summa Theologica III Qu.38 a.6)