Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
bayhaqi:2242Abū Bakr Aḥmad b. al-Ḥasan al-Qāḍī > Abū al-ʿAbbās Muḥammad b. Yaʿqūb > Baḥr b. Naṣr > Quriʾ > Ibn WahbAkhbarak al-Ḥārith b. Nabhān > Muḥammad b. ʿUbaydullāh > ʿAṭāʾ b. Abū Rabāḥ > Jābir b. ʿAbdullāh

[Machine] We prayed one night in the clouds, and the direction of prayer was hidden from us. We were taught a sign, and when we finished, we looked and realized that we had prayed towards a different direction. We then informed the Messenger of Allah ﷺ about this, and he said, "You have done well, and we were not commanded to repeat it." This was narrated by Muhammad bin Salim from Ata and from Abd Malik al-Arzami from Ata. As for the narration of Muhammad bin Salim from Ata, it has already been mentioned, and as for the narration of Abd Malik, it is found in the collection of Ahmad bin Ubaydullah bin al-Hasan al-Anbari from his father.  

البيهقي:٢٢٤٢وَأَخْبَرَنَا أَبُو بَكْرٍ أَحْمَدُ بْنُ الْحَسَنِ الْقَاضِي ثنا أَبُو الْعَبَّاسِ مُحَمَّدُ بْنُ يَعْقُوبَ ثنا بَحْرُ بْنُ نَصْرٍ قَالَ قُرِئَ عَلَى ابْنِ وَهْبٍ أَخْبَرَكَ الْحَارِثُ بْنُ نَبْهَانَ عَنْ مُحَمَّدِ بْنِ عُبَيْدِ اللهِ عَنْ عَطَاءِ بْنِ أَبِي رَبَاحٍ عَنْ جَابِرِ بْنِ عَبْدِ اللهِ ؓ قَالَ

صَلَّيْنَا لَيْلَةً فِي غَيْمٍ وَخَفِيَتْ عَلَيْنَا الْقِبْلَةُ وَعَلَّمْنَا عَلَمًا فَلَمَّا انْصَرَفْنَا نَظَرْنَا فَإِذَا نَحْنُ قَدْ صَلَّيْنَا إِلَى غَيْرِ الْقِبْلَةِ فَذَكَرْنَا ذَلِكَ لِرَسُولِ اللهِ ﷺ فَقَالَ قَدْ أَحْسَنْتُمْ وَلَمْ يَأْمُرْنَا أَنْ نُعِيدَ وَكَذَلِكَ رُوِيَ عَنْ مُحَمَّدِ بْنِ سَالِمٍ عَنْ عَطَاءٍ وَعَنْ عَبْدِ الْمَلِكِ الْعَرْزَمِيِّ عَنْ عَطَاءٍ أَمَّا حَدِيثُ مُحَمَّدِ بْنِ سَالِمٍ عَنْ عَطَاءٍ فَقَدْ مَضَى وَأَمَّا حَدِيثُ عَبْدِ الْمَلِكِ فَإِنَّهُ فِي وِجَادَاتِ أَحْمَدَ بْنِ عُبَيْدِ اللهِ بْنِ الْحَسَنِ الْعَنْبَرِيِّ عَنْ أَبِيهِ