Abdullah bin Umar reported,

While the Prophet ﷺ was praying, he noticed some phlegm on the wall facing the qiblah of the mosque. He scraped it off with his hand and became visibly angry. Then he said, "When one of you is praying, Allah is directly before his face, so let none of you spit in front of him during the prayer."

Azami 15008

Sahih

عن عبد الله بن عمر قال

بينا النبي ﷺ يصلي، رأى في قبلة المسجد نخامة، فحكها بيده، فتغيظ، ثم قال: إن أحدكم إذا كان في الصلاة، فإن الله حيال وجهه، فلا يتنخمن حيال وجهه في الصلاة.

الأعظمي 15008صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Superior moral conduct
Chapter
Vices of character
Section
When anger is permissible
Numbering
Jami al-Kamil 15008 (2nd edition)
Azami 15008