Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:41:22

And you were not covering yourselves, lest your hearing testify against you or your sight or your skins, but you assumed that Allah does not know much of what you do.  

And you did not use to conceal yourselves, when you used to commit lewd acts, lest your hearing or your eyes or your skins should bear witness against you, because you were never certain about ˹the truth of˺ resurrection; but you thought, when you used to conceal yourselves, that God did not know most of what you did.
القرآن:٤١:٢٢

وَمَا كُنْتُمْ تَسْتَتِرُونَ أَنْ يَشْهَدَ عَلَيْكُمْ سَمْعُكُمْ وَلَا أَبْصَارُكُمْ وَلَا جُلُودُكُمْ وَلَٰكِنْ ظَنَنْتُمْ أَنَّ اللَّهَ لَا يَعْلَمُ كَثِيرًا مِمَّا تَعْمَلُونَ  

{وما كنتم تستترون} عن ارتكابكم الفواحش من {أن يشهد عليكم سمعكم ولا أبصاركم ولا جلودكم} لأنكم لم توقنوا بالبعث {ولكن ظننتم} عند استتاركم {أن الله لا يعلم كثيراً مما تعملون}.