He traced it back to the Prophet ﷺ, who said, "The fornicator does not commit fornication while he is a believer, the thief does not steal while he is a believer, and the drinker of wine does not drink it while he is a believer. Yet Tawba remains open afterward."
حدثنا عبد الرزاق قال أنبأنا سفيان عن الأعمش عن ذكوان
رفعه قال لا يزني الزاني وهو مؤمن ولا يسرق السارق حين يسرق وهو مؤمن ولا يشرب الخمر حين يشرب وهو مؤمن والتوبة معروضة بعد
Its isnad is sahih. Bukhari related it in 195/8, in the book of legal punishments, "One does not drink wine", and in 197/8, and Muslim in 77/1, no. 57, in the book of faith, on the explanation that faith diminishes through sins, and Abu Dawud in 221/4, no. 4689, in the book of the sunnah, on the evidence that faith increases and decreases, and Nasai in 65/8, no. 4871, their wordings being close to one another, and it has already appeared at 7332.