Jabir bin Abdullah reported,

We did not pledge allegiance to the Messenger of Allah ﷺ on death. Rather, we pledged to him that we would not flee.

Muslim 4808

Sahih

و حدثنا أبو بكر بن أبي شيبة حدثنا ابن عيينة ح و حدثنا ابن نمير حدثنا سفيان عن أبي الزبير

عن جابر قال

لم نبايع رسول الله ﷺ على الموت إنما بايعناه على أن لا نفر

مسلم 4808صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Leadership
Chapter
Recommendation of pledging allegiance to the commander of the army when intending to fight, and description of the pledge of Ridwan under the tree
Numbering
Darussalam 4808
Muslim 4808