Sahih Muslim 867: Mosques and Places of Prayer
It is narrated from Ibn Shihab that he said: Ata’ bin Abi Rabah told me that Hazrat Jabir bin Abdullah (ra) said, and in the narration of Harmalah it says that he thought, that the Messenger of Allah (saw) said: “Whoever eats garlic or onion, let him keep away from us”, or he said: “let him keep away from our mosque and sit in his house.” And that a pot was presented to him (saw) in which there were some vegetables. He (saw) noticed a smell from them and asked about it. He (saw) was told which vegetables were in it. He (saw) said: “Bring them near one of his Companions (ra).” He (saw) saw that this (Companion (ra)) disliked eating it. He (saw) said: “Eat, for indeed I hold intimate converse with One with whom you do not hold intimate converse.”
AI-translated by Islam-Today