Assalamu alaykum. Suppose i prayed in a masjid for a whole month, then i came to know that the imam is a pure berelwi, who has severe shirki aqidah. Now are my all previous prayers invalid? Should i repeat them?
All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad, sallallaahu 'alayhi wa sallam, is His slave and Messenger.
First of all, you should know that not everyone who is affiliated to an innovated sect, or who did an act of polytheism is judged to be a polytheist until the conditions (for judging him as such) are met while there are no impediments that prevent from declaring him so.
With regard to your question, whoever prayed behind an imam while he did not know about his condition, then he found out that he was a polytheist with the condition that we have mentioned, then there is a difference of opinion among the jurists about him in making up his prayer [that he had prayed behind that person].
In order to be on the safe side, it is better to repeat the prayer.
Since you write to us in Arabic sometimes, then we refer you to Fatwa 198873 in our Arabic website entitled “The Ruling on Praying behind People of Wrong Beliefs.”
Allah knows best.
You can search for fatwa through many choices