While the people were performing the dawn prayer at Quba, a man came to them and said, "Quran was revealed during the night commanding that the Kaabah be faced." So they turned toward it. They had been facing Sham, and they pivoted as they were until they faced the Kaabah.
حدثنا موسى بن إسماعيل حدثنا عبد العزيز بن مسلم حدثنا عبد الله بن دينار قال سمعت
بينا الناس في الصبح بقباء إذ جاءهم رجل فقال أنزل الليلة قرآن فأمر أن يستقبل الكعبة فاستقبلوها واستداروا كهيئتهم فتوجهوا إلى الكعبة وكان وجه الناس إلى الشأم