Add missing login.tpl and add necessary template listeners