It was narrated from Ibn Abbas that the Messenger of Allah (ﷺ) said:“Do not carry out the legal punishment in the mosque.”
Hadith No. 2599
Sunan Ibn Majah
Gradings:
Al-Albani:
Hasan
Muhammad Fouad Abd al-Baqi:
Hasan
Zubair Ali Zai:
Daif