[Machine] When the Messenger of Allah ﷺ was directed towards the Kaaba, they said, "O Messenger of Allah, what about those who died while they were praying towards Al-Masjid Al-Aqsa?" So Allah sent down the verse {And Allah would not let your faith go to waste} [Quran 2:143] until the end of the verse. 'Ubaydullah ibn Musa said, "This hadith informs you that prayer is a part of faith."
لَمَّا وُجِّهَ رَسُولُ اللَّهِ ﷺ إِلَى الْكَعْبَةِ قَالُوا يَا رَسُولَ اللَّهِ فَكَيْفَ بِالَّذِينَ مَاتُوا وَهُمْ يُصَلُّونَ إِلَى بَيْتِ الْمَقْدِسِ؟ فَأَنْزَلَ اللَّهُ {وَمَا كَانَ اللَّهُ لِيُضِيعَ إِيمَانَكُمْ} [البقرة 143] إِلَى آخِرِ الْآيَةِ قَالَ عُبَيْدُ اللَّهِ بْنُ مُوسَى «هَذَا الْحَدِيثُ يُخْبِرُكَ أَنَّ الصَّلَاةَ مِنَ الْإِيمَانِ»