Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
ahmad:4607Ibn Idrīs > ʿUbaydullāh > Nāfiʿ > Ibn ʿUmar

[Machine] We used to sleep in the mosque during the time of the Prophet Muhammad ﷺ . We would stay the night and we were young.  

أحمد:٤٦٠٧حَدَّثَنَا ابْنُ إِدْرِيسَ أَخْبَرَنَا عُبَيْدُ اللهِ عَنْ نَافِعٍ عَنِ ابْنِ عُمَرَ قَالَ

كُنَّا فِي زَمَنِ رَسُولِ اللهِ ﷺ نَنَامُ فِيالْمَسْجِدِ نَقِيلُ فِيهِ وَنَحْنُ شَبَابٌ  


See similar narrations below:

Collected by Tirmidhī
tirmidhi:321Maḥmūd b. Ghaylān > ʿAbd al-Razzāq > Maʿmar > al-Zuhrī > Sālim > Ibn ʿUmar

"We would sleep in the Masjid during the time of Messenger of Allah and we were young men."  

الترمذي:٣٢١حَدَّثَنَا مَحْمُودُ بْنُ غَيْلاَنَ حَدَّثَنَا عَبْدُ الرَّزَّاقِ أَخْبَرَنَا مَعْمَرٌ عَنِ الزُّهْرِيِّ عَنْ سَالِمٍ عَنِ ابْنِ عُمَرَ قَالَ

كُنَّا نَنَامُ عَلَى عَهْدِ رَسُولِ اللَّهِ ﷺ فِي الْمَسْجِدِ وَنَحْنُ شَبَابٌ  

قَالَ أَبُو عِيسَى حَدِيثُ ابْنِ عُمَرَ حَدِيثٌ حَسَنٌ صَحِيحٌ وَقَدْ رَخَّصَ قَوْمٌ مِنْ أَهْلِ الْعِلْمِ فِي النَّوْمِ فِي الْمَسْجِدِ قَالَ ابْنُ عَبَّاسٍ لاَ يَتَّخِذُهُ مَبِيتًا وَلاَ مَقِيلاً وَقَوْمٌ مِنْ أَهْلِ الْعِلْمِ ذَهَبُوا إِلَى قَوْلِ ابْنِ عَبَّاسٍ