Try catch around console log override
Do login hiding both before and after template rendering