Salama bin Akwa reported,

Ali had stayed behind from the Prophet ﷺ at Khaybar because he was suffering from an eye ailment. Then he said, "Am I to stay behind from the Messenger of Allah ﷺ?" So Ali set out and caught up with the Prophet ﷺ.On the eve of the night before the morning Allah granted the conquest, the Messenger of Allah ﷺ said, "Tomorrow I shall surely give the banner," or he said, "the banner shall surely be taken by a man whom Allah and His Messenger love," or he said, "who loves Allah and His Messenger. Allah will grant him victory."Suddenly we saw Ali, though we had not expected him. The people said, "Here is Ali." So the Messenger of Allah ﷺ gave it to him, and Allah granted him the victory.

Azami 9917

Sahih

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

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

الأعظمي 9917صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Virtues of the Companions and reports about them
Chapter
Virtues and reports of Ali bin Abu Talib
Section
Prophet's ﷺ glad tidings that Allah would open Khaybar at the hands of Ali, and that Allah and His Messenger love him
Numbering
Jami al-Kamil 9917 (2nd edition)
Azami 9917