Umm Salamah reported: I said, “O Messenger of Allah, how often you supplicate saying: O Turner of the hearts, keep my heart firm upon Your religion!” The Messenger of Allah, peace and blessings be upon him, said, “O Umm Salamah, there is no human but that his heart is between the fingers of Allah. Whoever He wills is kept steadfast, and whoever He wills is deviated.” Mu’adh recited the verse, “Our Lord, do not let our hearts deviate after you have guided us!” (3:8)
Source: Sunan al-Tirmidhī 3522
Grade: Hasan (authentic) according to Al-Tirmidhi
عن أم سلمة قَالَتْ فَقُلْتُ يَا رَسُولَ اللَّهِ مَا أَكْثَرَ دُعَاءَكَ يَا مُقَلِّبَ الْقُلُوبِ ثَبِّتْ قَلْبِي عَلَى دِينِكَ قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ يَا أُمَّ سَلَمَةَ إِنَّهُ لَيْسَ آدَمِيٌّ إِلَّا وَقَلْبُهُ بَيْنَ أُصْبُعَيْنِ مِنْ أَصَابِعِ اللَّهِ فَمَنْ شَاءَ أَقَامَ وَمَنْ شَاءَ أَزَاغَ فَتَلَا مُعَاذٌ رَبَّنَا لَا تُزِغْ قُلُوبَنَا بَعْدَ إِذْ هَدَيْتَنَا
3522 سنن الترمذي كتاب الدعوات باب منه
5/495 المحدث الترمذي خلاصة حكم المحدث حسن في سنن الترمذي