Sahih al-Bukhari 1213
صحيح البخاري#1213SahihNarrated Ibn `Umar:The Prophet (ﷺ) saw some sputum on the wall facing the Qibla of the mosque and became furious with the people of the mosque and said, "During the prayer, Allah is in front of everyone of you and so he should not spit (or said, 'He should not expectorate')." Then he got down and scratched the sputum with his hand. Ibn `Umar said (after narrating), "If anyone of you has to spit during the prayer, he should spit to his left
Scholarly Authentication
We show the most cautious grade (weakest-wins) as the overall label. Individual scholars graded it as follows:
Every narration in Sahih al-Bukhari is accepted as Sahih (authentic) by the established status of the book.
In-book reference: 21:17