A man passed by the Prophet ﷺ while another man was sitting with him. The man said, "By Allah, Messenger of Allah, I truly love this man for the sake of Allah."The Messenger of Allah ﷺ asked, "Have you told him so?"He replied, "No."The Prophet ﷺ said, "Get up and tell him, so that affection may be firmly established between you."So he went over to him and said, "I love you for the sake of Allah," or he said, "I love you for Allah."The other man replied, "May He for whose sake you love me love you in return."
حدثنا مؤمل حدثنا حماد حدثنا ثابت
مر رجل بالنبي ﷺ وعند النبي ﷺ رجل جالس فقال الرجل والله يا رسول الله إني لأحب هذا في الله فقال رسول الله ﷺ أخبرته بذلك قال لا قال قم فأخبره تثبت المودة بينكما فقام إليه فأخبره فقال أني أحبك في الله أو قال أحبك لله فقال الرجل أحبك الذي أحببتني فيه
Its chain of transmission is sahih, mentioned previously at 12528.