Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him) narrates: The Prophet (peace and blessings be upon him) said: "Whoever performs the prayer well when people are watching him, and performs it badly when he is alone, that is an act of contempt by which he shows contempt for his Lord."
Abu Ya'la recorded it; its chain contains a narrator, Ibrahim bin Muslim al-Hajari, and he is da'if (weak).
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الزهد / 17653