He put on the Prophet's garment and slept in his bed when...
He put on the Prophet's garment and slept in his bed when the infidels sought to murder him," till he says: "The Messenger of Allah (pbuh) went on Tabuk expedition accompanied by many people. ‘Ali asked him: ‘May I join you?' The Messenger of Allah (pbuh) refused, whereupon ‘Ali wept. The Prophet (pbuh) then asked him: ‘Does it not please you that your status to me is similar to that of Aaron's to Moses, except there is no Prophet after me?
It is not proper for me to leave this place before assigning you as my vicegerent.' The Messenger of Allah (pbuh) has also said the following to him: ‘You are the wali of every believing man and woman.'" Ibn ‘Abbas has said: "The Messenger of Allah closed down all doors leading to his mosque except that of ‘Ali who used to enter the mosque on his way out even while in the state of janaba .
The Messenger of Allah (pbuh) has also said: ‘Whoever accepts me as the wali , let him/her take ‘Ali as the wali , too.'" As a matter of fact, al-Hakim, having counted the sources from which he quoted this hadith, comments by saying, "This is an authentic hadith according to isnad , yet both shaykhs did not narrate it this way." Al-Thahbi has quoted it in his Talkhis and described it as an authentic hadith. II Why Rely Upon it.
Clear and irrefutable proofs highlight the fact that ‘Ali was the Prophet's vicegerent. Have you noticed how the Prophet (pbuh) has named him wali in this life and the life to come, thus favouring him over all his kin, and how he regarded his status to himself as similar to that of Aaron to Moses, without any exception other than Prophethood, and exception which reflects generality?
You also know that what distinguished Aaron from Moses was mostly his being the vizier of his brother, his de facto participation in his brother's Message, his vicegerency, and the enforcement by Moses of people's obedience to Aaron as his statement, to which references is included in the Holy Qur'an (20:29-32), and which clearly says: "And let my brother Aaron, from among my household, be my vizier, to support me and take part in my affair," and his statement: "Be my own representative among my people; reform them, and do not follow the path of corrupters (Qur'an 7:142)," and the Almighty's response: "O Moses!