Answered by our Shaykh, the ‘Allaamah, the Sincere Adviser, Abu ‘Abdirrahman Yahya bin ‘Ali Al-Hajoori – may Allaah preserve him –
What is the ruling of the one who is using the toilet whilst facing the qiblah?
Turn away from it, and when he leaves he says astaghfirullah, just like Abu Ayoub, may Allaah be pleased with him, did when he went to Shaam and found that all of the toilets were built facing in the direction of the qiblah, so he turned away from it and said astaghfirullah. [Reported by Al-Bukhari and Muslim]
Translated by : Abu Huthayfah Saamy Al-hindy
الكنز الثمين في الإجابة على أسئلة طلبة العلم والزائرين (2)
Under: كتاب الطهارة
Entitled: حكم استقبال القبلة أثناء قضاء الحاجة