Sunan an-Nasa'i, Volume 6, Book 47, Hadith 5021 (DarusSalam) ⓘ
It was narrated that Zirr said: 'Ali said: "The Unlettered Prophet [SAW] made a covenant with me, that none but a believer would love me, and none but a hypocrite would hate me."
أَخْبَرَنَا يُوسُفُ بْنُ عِيسَى قَالَ أَنْبَأَنَا الْفَضْلُ بْنُ مُوسَى قَالَ أَنْبَأَنَا الْأَعْمَشُ عَنْ عَدِيٍّ عَنْ زِرٍّ قَالَ قَالَ عَلِيٌّ إِنَّهُ لَعَهْدُ النَّبِيِّ الْأُمِّيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ إِلَيَّ أَنَّهُ لَا يُحِبُّكَ إِلَّا مُؤْمِنٌ وَلَا يَبْغُضُكَ إِلَّا مُنَافِقٌ
also referenced under: Hadith 5018 (Reference) & Book 47, Hadith 34 (In-Book)