Anas bin Malik reported,

A man was sitting with the Prophet ﷺ when another man passed by. He said, "Messenger of Allah, I truly love this man."The Prophet ﷺ asked him, "Have you told him?"He replied, "No."The Prophet ﷺ said, "Tell him."So he caught up with the man and said, "I love you for the sake of Allah."The other man replied, "May the One for whose sake you love me also love you."

Azami 11315

Sahih

عن أنس بن مالك

أن رجلا كان عند النبي ﷺ، فمر به رجل فقال: يا رسول الله، إني لأحب هذا، فقال له النبي ﷺ: أعلمته؟ قال: لا، قال: أعلمه قال: فلحقه، فقال: إني أحبك في الله، فقال: أحبك الذي أحببتني له.

الأعظمي 11315صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Supplications, remembrances, and prayer upon the chosen Prophet ﷺ
Chapter
Supplications for various occasions
Section
What one says to his brother when he says, "I love you for the sake of Allah"
Numbering
Jami al-Kamil 11315 (2nd edition)
Azami 11315