It was narrated from Ibn Abbas that the Messenger of Allah (ﷺ) said:
"Do not carry out the legal punishment in the mosque."
English reference: Vol. 3, Book 20, Hadith 2599
Arabic reference: Book 20, Hadith 2697
Read hadith from the major collections in the app, with prayer times and a Qibla compass. Free.