And some have said that (the pledge was) upon death, because Allah the Exalted has said in Surah Al-Fath «لقد رضي الله عن المؤمنين إذ يبايعونك تحت الشجرة» "Indeed, Allah was pleased with the believers when they gave you the pledge under the tree