The Prophet ﷺ saw some phlegm on the wall facing the qiblah of the mosque while he was leading the people in prayer, so he scraped it off. When he finished the prayer, he said, "When one of you is praying, Allah is before his face, so none of you should spit in front of himself during the prayer."
حدثنا أبو سلمة أخبرنا ليث عن نافع
أن النبي ﷺ رأى نخامة في قبلة المسجد وهو يصلي بين يدي الناس فحتها ثم قال حين انصرف من الصلاة إن أحدكم إذا كان في الصلاة فإن الله عز وجل قبل وجهه فلا يتنخمن أحد قبل وجهه في الصلاة