The Messenger of Allah ﷺ said, "There is no servant who spends the night in a state of purity, then wakes during the night and asks Allah for something pertaining to this world or the Hereafter, except that He grants it to him."
حدثنا علي بن محمد حدثنا أبو الحسين عن حماد بن سلمة عن عاصم بن أبي النجود عن شهر بن حوشب عن أبي ظبية
قال رسول الله ﷺ ما من عبد بات على طهور ثم تعار من الليل فسأل الله شيئا من أمر الدنيا أو من أمر الآخرة إلا أعطاه
No references are available.
[Its chain of transmission is hasan] Abu Dawud narrated it in Kitab al-Adab, chapter on sleeping on one's back, hadith 5042, from the hadith of Hammad, transmitted through this route. Thabit Bunani also narrated it from Abu Zabyah through this route, and with this the hadith is confirmed as sahih...