ذِكْرُ تَسْمِيَةِ اللَّهِ جَلَّ وَعَلَا صَلَاةَ مَنْ صَلَّى إِلَى بَيْتِ الْمَقْدِسِ فِي تِلْكَ الْمُدَّةِ إِيمَانًا
when the Prophet (May peace be upon him) turned towards the Ka’bah (in prayer), the people asked : Messenger of Allah (May peace be upon him)! what will happen with those who died while they prayed with their faces towards Jerusalem ? Allah the Exalted, then revealed : “And never would Allah make your faith of no effect.” (Using translation from Abū Dāʾūd 4680)
«لَمَّا وُجِّهَ النَّبِيُّ ﷺ إِلَى الْكَعْبَةِ قَالُوا كَيْفَ بِمَنْ مَاتَ مِنْ إِخْوَانِنَا وَهُمْ يُصَلُّونَ نَحْوَ بَيْتِ الْمَقْدِسِ؟ » فَأَنْزَلَ اللَّهُ جَلَّ وَعَلَا {وَمَا كَانَ اللَّهُ لِيُضِيعَ إِيمَانَكُمْ}