Ali ibn Ibrahim from Muhammad ibn Isa from Mu‘awiyah ibn Wahb who said:
I asked Abu Abdillah عليه السلام, peace be upon him, about sleeping in the ‘Sacred Mosque’ (al-Masjid al-Haram) and the ‘Mosque of the Messenger صلى الله عليه وعلى آله وسلم’. Imam عليه السلام said: “Yes. Where else would people sleep?”
Ali Akbar al-Ghaffari
Tahdhīb al-Aḥkām fī Sharḥ al-Muqniʿah, vol. 3, p. 284