We used to sleep in the mosque during the time of the Messenger of Allah ﷺ when we were young men.
حدثنا محمود بن غيلان حدثنا عبد الرزاق أخبرنا معمر عن الزهري عن سالم
كنا ننام على عهد رسول الله ﷺ في المسجد ونحن شباب
Agreed upon [by Bukhari and Muslim]. Bukhari related it in the Book of Tahajjud, Chapter on the Merit of Standing in Prayer at Night, hadith no. 1121, and Muslim, hadith no. 2479, from the hadith of Muamar bin Rashid, through this same route. As for the statement of Ibn Abbas, I have not been able to locate it.