'Umar asked the verdict of the Shari'ah from the Apostle ﷺ thus: Is it permissible for any one of us to sleep in a state of impurity? He (the Prophet said: Yes, he must perform ablution and then sleep and take a bath when he desires.
أَنَّ عُمَرَ اسْتَفْتَى النَّبِيَّ ﷺ فَقَالَ هَلْ يَنَامُ أَحَدُنَا وَهُوَ جُنُبٌ قَالَ نَعَمْ لِيَتَوَضَّأْ ثُمَّ لْيَنَمْ حَتَّى يَغْتَسِلَ إِذَا شَاءَ