The Messenger of Allah ﷺ said, "There are three to whom Allah will not speak on the Day of Resurrection, nor will He purify them, and they will have a painful punishment. A man who pledges allegiance to a leader, so that if the leader gives him something he fulfills his pledge, but if the leader does not give him anything he does not fulfill it."
حدثنا أبو عمار حدثنا وكيع عن الأعمش عن أبي صالح
قال رسول الله ﷺ ثلاثة لا يكلمهم الله يوم القيامة ولا يزكيهم ولهم عذاب أليم رجل بايع إماما فإن أعطاه وفى له وإن لم يعطه لم يف له
Sourced as agreed upon by Bukhari and Muslim. Bukhari narrated it in the Book of Testimonies, the Chapter on taking an oath after Asr, hadith no. 2672, and Muslim narrated it, hadith no. 108, both from the hadith of Sulayman Amash with this same wording.