We used to pledge allegiance to the Messenger of Allah ﷺ upon hearing and obeying, and he would say, "In what you are able to do."Ali said, "In what you are able to do."
أخبرنا قتيبة قال حدثنا سفيان عن عبد الله بن دينار ح و أخبرني علي بن حجر عن إسمعيل عن عبد الله بن دينار
كنا نبايع رسول الله ﷺ على السمع والطاعة ثم يقول فيما استطعت وقال علي فيما استطعتم
Muslim narrated it, in the chapter on leadership, the section on pledging allegiance to listen and obey to the extent of one's ability, hadith no. 1867, from Ali bin Hajar and others through this chain, and it is in Kubra, hadith no. 7810, and see the hadith that follows.