Question: Is it considered ascribing partners to Allah (shirk) if one has the thought in their heart that they are prostrating to the person sitting in front of them? How do we deal with blameworthy thoughts, especially in prayer?
Answer: In the Name of Allah, the Most Merciful and Compassionate
If one is praying toward the back of someone in front of them and the thought comes to their mind that they are prostrating to that person – one should immediately disregard such a thought. Such thoughts are from Satan and one is not held accountable for such thoughts.
“There is no harm in praying toward the back of someone sitting and talking…” [Murghinani, al-Hidaya].
However, it is prohibitively disliked to pray toward the face of someone in front of the one praying [Murghinani, al-Hidaya].
Hope this helps
Allahu A’alam
[Shaykh] Yusuf Weltch
Checked and Approved by Shaykh Faraz Rabbani