Chapter: Prohibiting one who has eaten garlic, onions, or leeks, and other things that have an offensive odor from coming to the masjid, until that smell has gone away, and such a person should be expelled from the masjid
Abu Huraira reported: The Messenger of Allah ( صلی اللہ علیہ وسلم ) said: He who eats of this plant (garlic) should not approach our mosque and should not harm us with the odour of garlic.
Authentic