I believe this is from the Messenger of Allah ﷺ, who said, "Whoever spits in the direction of the qiblah will come on the Day of Resurrection with his spittle between his eyes, and whoever eats from this foul vegetable must not come near our mosque." He said it three times.
حدثنا عثمان بن أبي شيبة حدثنا جرير عن الشيباني عن عدي بن ثابت عن زر بن حبيش
أظنه عن رسول الله ﷺ قال من تفل تجاه القبلة جاء يوم القيامة تفله بين عينيه ومن أكل من هذه البقلة الخبيثة فلا يقربن مسجدنا ثلاثا
[Its isnad is daif] Bayhaqi (3/76) narrated it from the hadith of Abu Dawud, through the same chain. Ibn Abu Shayba (2/365) narrated it as a stopped narration (mawquf), and Ibn Khuzayma, hadith 925, 1314, 1663, and Ibn Hibban, hadith 332, graded it sahih as a stopped narration, its isnad being sahih, and this is the correct view.