"He who has eaten onion or garlic or leek should not approach our masjid, because the angels are also offended by the strong smells that offend the children of Adam."
According to Sunnah.com, the following hadith has been collected in Sahih Muslim:
Jabir b. 'Abdullah reported the Messenger of Allah saying: He who eats of this (offensive) plant, i. e garlic, and sometimes he said: He who eats onion and garlic and leek, should not approach our mosque for the angels are harmed by the same things as the children of Adam.
This has been narrated through the chain of
and is generally considered authentic by Sunni Muslims.