Answered by Ustadh Tabraze Azam
Question: Assalam ‘aleykum,
At one point in my life I became delirious and at that point I had a thought that Allah does not exist and that the purpose of Prayer is to gain control over the mind. Immediately after I asked Allah for forgiveness. Is this considered to be major shirk?
Answer: Wa alaikum assalam wa rahmatullahi wa barakatuh,
I pray that you are in the best of health and faith, insha’Allah.
Yes, you are a believer.
Shaykh Nuh Keller comments, “As long as one has fear and disgust for passing thoughts of unbelief (kufr) and the like and does not make them convictions, they do no harm.” [Sea Without Shore]
Please see: Passing Blasphemous Thoughts Leading to Despair and: What is the Ruling For Someone Who Has Thoughts of Disbelief Without Saying Them Aloud?
And Allah alone gives success.
Checked & Approved by Faraz Rabbani