mod_authentication: refactor logon templates

#861