Answered by Shaykh Faraz Rabbani
If someone walks in front of while you are praying does that make your salah invalid? Will I need to repeat my salah?
In the Name of Allah, Most Merciful & Compassionate
It is recommended to place a barrier (sutra) in front of one when praying, if one thinks that someone may pass in front of one. [Shurunbulali, Maraqi al-Falah] This doesn’t affect the validity of one’s prayer: if someone walks by, one’s prayer remains valid.
It is sinful to walk immediately in front of someone praying when it is easy to avoid.
Faraz Rabbani.
Please also see the following links in answer to your question: