(10) باب الْقَضَاءِ وَالْفُتْيَا فِي الطَّرِيقِ
Narrated Anas bin Malik:
While the Prophet (ﷺ) and I were coming out of the mosque, a man met us outside the gate. The man said, "O Allah's Messenger (ﷺ)! When will be the Hour?" The Prophet (ﷺ) asked him, "What have you prepared for it?" The man became afraid and ashamed and then said, "O Allah's Messenger (ﷺ)! I haven't prepared for it much of fasts, prayers or charitable gifts but I love Allah and His Apostle." The Prophet (ﷺ) said, "You will be with the one whom you love."
Reference: Sahih al-Bukhari 7153
In-book reference: Book 93, Hadith 17
USC-MSA web (English) reference(deprecated numbering scheme): Vol. 9, Book 89, Hadith 267