Salama bin Akwa reported,

Ali had stayed behind from the Prophet ﷺ during the expedition to Khaybar because he was suffering from an eye ailment. He said, "Shall I stay behind from the Messenger of Allah ﷺ?" So Ali set out and caught up with the Prophet ﷺ.On the eve of the day Allah granted the conquest, the Messenger of Allah ﷺ said, "Tomorrow I will surely give the banner to a man whom Allah and His Messenger love," or he said, "who loves Allah and His Messenger. Allah will grant victory through him."Then suddenly there was Ali, though we had not expected him. The people said, "Here is Ali." So the Messenger of Allah ﷺ gave him the banner, and Allah granted him victory.

Muslim 6224

Sahih

حدثنا قتيبة بن سعيد حدثنا حاتم يعني ابن إسمعيل عن يزيد بن أبي عبيد

عن سلمة بن الأكوع قال

كان علي قد تخلف عن النبي ﷺ في خيبر وكان رمدا فقال أنا أتخلف عن رسول الله ﷺ فخرج علي فلحق بالنبي ﷺ فلما كان مساء الليلة التي فتحها الله في صباحها قال رسول الله ﷺ لأعطين الراية أو ليأخذن بالراية غدا رجل يحبه الله ورسوله أو قال يحب الله ورسوله يفتح الله عليه فإذا نحن بعلي وما نرجوه فقالوا هذا علي فأعطاه رسول الله ﷺ الراية ففتح الله عليه

مسلم 6224صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Virtues of the Companions, may Allah be pleased with them
Chapter
From the virtues of Ali bin Abu Talib, may Allah be pleased with him
Numbering
Darussalam 6224
Muslim 6224