Sayyiduna Jabir bin Abdullah (may Allah be pleased with both of them) narrates that the Prophet Muhammad (peace be upon him) said: "Whoever has eaten this plant, garlic..." Then later he said: "And whoever has eaten onions or leek, he should not come near our mosque at all, because the angels are also bothered by what bothers humans."
Hadith Referenceصحيح ابن خزيمه / جماع أبواب العذر الذى يجوز فيه ترك إتيان الجماعة / 1665