Does dealing with certain morals to earn the reward in the afterlife and gain people's affection invalidate the recompense? And is intending to gain people's affection alone considered a sin?
One must differentiate between acts of worship intended for the glorification of Allah the Almighty, such as prayer (Salah) and fasting (Sawm), and those intended to achieve worldly benefits which then become acts of worship through intention, like giving gifts. Thus, seeking people's love through ethics, which are not acts of worship except by intention, does not make you sinful. If you add to this purpose the intention of seeking Allah's pleasure and drawing closer to Him, that would be good and you would be rewarded for it. As for acts that are purely worship, like prayer and similar acts, intending them for people is blameworthy ostentation (riya').
And Allah knows best.
Summarized from the full answer at Ftawy · reviewed Sep 2, 2026
Read the full answer on Ftawyhttps://ftawy.com/en/questions/124592