The Forty Hadith of Al-Nawawi. On the authority of the Leader of the Believers, Abu Hafs, 'Umar Ibn al-Khattab (may Allah be pleased with him), who said: I heard the Messenger of Allah (peace and blessings of Allah be upon him) say: "Actions are judged only by intentions, and every person will have only what they intended. Thus, whoever migrated for the sake of Allah and His Messenger, their migration is for Allah and His Messenger. And whoever migrated for worldly gain or to marry a woman, their migration is for whatever they migrated for." Related by al-Bukhari and Muslim. This hadith makes clear that the foundation for an action being accepted is the intention. For outward deeds, such as prayer or charity, are neither valid nor accepted unless performed sincerely for Allah alone. It also clarifies that a person's reward corresponds to their intention. Two people might perform the exact same deed, yet one is rewarded while the other is not, simply because of the difference in intention. An example of this: whoever migrates seeking the pleasure of Allah will be rewarded, whereas whoever migrates for a worldly interest, such as wealth or marriage, will only receive what they intended, without any reward in the Hereafter.