Abdullah bin Umar reported,

"I saw the Messenger of Allah ﷺ in his lavatory facing the qiblah."Isa said, I mentioned this to al-Shabi, and he said, "Ibn Umar spoke the truth, and Abu Hurairah spoke the truth. As for Abu Hurairah's statement, he was referring to being out in the open desert, where one should neither face the qiblah nor turn his back to it. As for Ibn Umar's statement, the lavatory has no qiblah, so face whichever direction you wish in it."Abu al-Hasan bin Salama said, Abu Hatim narrated to us, Ubaydullah bin Musa narrated to us, and he mentioned something similar.

Ibn Majah 323

Daif

حدثنا محمد بن يحيى حدثنا عبيد الله بن موسى عن عيسى الحناط عن نافع

عن ابن عمر قال

رأيت رسول الله ﷺ في كنيفه مستقبل القبلة قال عيسى فقلت ذلك للشعبي فقال صدق ابن عمر وصدق أبو هريرة أما قول أبي هريرة فقال في الصحراء لا يستقبل القبلة ولا يستدبرها وأما قول ابن عمر فإن الكنيف ليس فيه قبلة استقبل فيه حيث شئت قال أبو الحسن بن سلمة وحدثنا أبو حاتم حدثنا عبيد الله بن موسى فذكر نحوه

ابن ماجه 323ضعيف
Contents
Reference
Commentary
Ayat
Collection
Sunan Ibn Majah
Book
Purification and its sunnahs
Chapter
Concession for that in enclosed places and its permissibility, unlike open areas
Numbering
Darussalam 323
Ibn Majah 323