Hadithcore
Mishkat al-Masabih, 995

Abu Dharr reported God’s Messenger as saying, “God most high continues to turn favourably towards a servant while he is engaged in prayer as long as he does not look to the side, but if he does so He departs from him.” Ahmad, Abu Dawud, Nasa’i and Darimi transmitted it.

وَعَنْ أَبِي ذَرٍّ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: " لَا يَزَالُ اللَّهُ عَزَّ وَجَلَّ مُقْبِلًا عَلَى الْعَبْدِ وَهُوَ فِي صَلَاتِهِ مَا لَمْ يَلْتَفِتْ فَإِذَا الْتَفَتَ انْصَرَفَ عَنْهُ. رَوَاهُ أَحْمَدُ وَأَبُو دَاوُدَ وَالنَّسَائِيُّ وَالدَّارِمِيُّ

References1 variant
In-Book Reference
Book 4, Hadith 415