Al-Husayn bin Sa’eed, from Muhammad bin Al-Qasim, who said:
I asked Abu Al-Hasan عليه السلام about a person in a state of janabah sleeping in the mosque. Imam عليه السلام said: "He should perform wudu, and there is no harm in him sleeping in the mosque or passing through it."
Ali Akbar al-Ghaffari
Tahdhīb al-Aḥkām fī Sharḥ al-Muqniʿah, vol. 1, p. 394