I had no place to spend the night and no shelter during the time of the Messenger of Allah ﷺ except in the mosque.
حدثنا وكيع حدثنا العمري عن نافع
ما كان لي مبيت ولا مأوى على عهد رسول الله ﷺ إلا في المسجد
No references are available.
Its isnad is sahih. Something similar in meaning to it has already appeared at 4607 and 5389.