Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:48:10

Indeed, those who pledge allegiance to you, ˹O Muhammad˺ - they are actually pledging allegiance to Allah. The hand of Allah is over their hands. So he who breaks his word only breaks it to the detriment of himself. And he who fulfills that which he has promised Allah - He will give him a great reward.  

Truly those who pledge allegiance to you, the ‘Pledge of Beatitude’ (bay‘at al-ridwān) given at alHudaybiyya, in fact pledge allegiance to God — this ˹statement˺ is akin to: Whoever obeys the Messenger, verily obeys God ˹Q. 4:80˺. The Hand of God is above their hands, ˹the hands˺ with which they pledged allegiance to the Prophet, in other words, God, exalted be He, has observed their pledge of allegiance and will requite them in accordance with ˹their adherence to˺ it. So whoever reneges, ˹whoever˺ breaches the pledge, reneges — ˹that is˺ the evil consequences of his breach will eventually be — against his own soul; and whoever fulfils the covenant which he has made with God, He will give him (fa-sa-yu’tīhi; or read fa-sanu’tīhi, ‘We will give him’) a great reward.
القرآن:٤٨:١٠

إِنَّ الَّذِينَ يُبَايِعُونَكَ إِنَّمَا يُبَايِعُونَ اللَّهَ يَدُ اللَّهِ فَوْقَ أَيْدِيهِمْ ۚ فَمَنْ نَكَثَ فَإِنَّمَا يَنْكُثُ عَلَىٰ نَفْسِهِ ۖ وَمَنْ أَوْفَىٰ بِمَا عَاهَدَ عَلَيْهُ اللَّهَ فَسَيُؤْتِيهِ أَجْرًا عَظِيمًا  

(إن الذين يبايعونك) بيعة الرضوان بالحديبية. (إنما يبايعون الله) هو نحو "" من يطع الرسول فقد أطاع الله "" (يد الله فوق أيديهم) التي بايعوا بها النبي، أي هو تعالى مطلع على مبايعتهم فيجازيهم عليها (فمن نكث) نقض البيعة (فإنما ينكث) يرجع وبال نقضه (على نفسه ومن أوفى بما عاهد عليه الله فسيؤتيه) بالياء والنون (أجرا عظيما).