The Messenger of Allah ﷺ forbade us from facing the qiblah while urinating, yet I saw him, a year before he passed away, facing it.
حدثنا محمد بن بشار حدثنا وهب بن جرير حدثنا أبي قال سمعت محمد بن إسحق عن أبان بن صالح عن مجاهد
نهى رسول الله ﷺ أن نستقبل القبلة ببول فرأيته قبل أن يقبض بعام يستقبلها
[Hasan] Abu Dawud narrated it in the chapter on Purification, the section on the permission given regarding that, hadith no. 13, from Muhammad bin Bashshar with this chain. Tirmidhi graded it hasan, hadith no. 9, and Ibn Khuzayma, Ibn Hibban, Hakim, Dhahabi, and others graded it sahih.