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