Al-Hasan al-Basri (may Allah have mercy on him) was asked about the ruling on taking a midday nap in the mosque. He said: I saw Sayyiduna Uthman bin Affan (may Allah be pleased with him), when he was the Caliph, taking his midday nap in the mosque. When he got up, the marks of the pebbles would be on his side, and he would say: This is the Commander of the Faithful.
(b) The narrator Yunus moved his finger, and Abu Bakr also moved his finger, "and at that time we were boys." Abu Bakr said: I said to Yunus: How old was al-Hasan (may Allah have mercy on him) when Sayyiduna Uthman bin Affan (may Allah be pleased with him) was martyred? He said: Fourteen years. Al-Hasan (may Allah have mercy on him) was born when two years of the caliphate of Sayyiduna Umar (may Allah be pleased with him) remained.
(c) It is reported from Ibn Mas'ud and Ibn Abbas (may Allah be pleased with them), and then from Mujahid and Sa'id bin Jubayr (may Allah have mercy on them), what indicates that they disliked sleeping in the mosque; it seems that they preferred that whoever has a dwelling should not go to the mosque for the purpose of sleeping in it.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 4341