diff --git a/lib/controllers.js b/lib/controllers.js index 7a12285..46e4687 100644 --- a/lib/controllers.js +++ b/lib/controllers.js @@ -33,8 +33,8 @@ async function getGroups(set) { groupNames = groupNames.filter(groupName => groupName && !groups.isPrivilegeGroup(groupName)); return groupNames.map(groupName => ({ - name: validator.escape(String(groupName)), - value: validator.escape(String(groupName)), + name: groupName, + value: groupName, })); } @@ -74,7 +74,7 @@ Controllers.renderChoices = async (req, res) => { hasAuthn, hasTotp, hasBackupCodes, - next: validator.escape(req.query.next), + next: req.query.next, title: '[[2factor:title]]', }); }; @@ -101,7 +101,7 @@ Controllers.renderTotpChallenge = async (req, res, next) => { res.render('login-totp', { single, error: error[0], - next: validator.escape(req.query.next), + next: req.query.next, }); }, error.length ? 2500 : undefined); }; @@ -131,13 +131,11 @@ Controllers.renderAuthnChallenge = async (req, res, next) => { req.session.authRequest = authnOptions.challenge; } - devices.forEach((d) => { d.name = validator.escape(d.name); }); - res.render('login-authn', { single, authnOptions, devices, - next: validator.escape(req.query.next), + next: req.query.next, }); }; @@ -180,7 +178,7 @@ Controllers.renderBackup = async (req, res, next) => { res.render('login-backup', { single, error: error[0], - next: validator.escape(req.query.next), + next: req.query.next, }); }, error.length ? 2500 : undefined); }; diff --git a/package.json b/package.json index 11ba348..6fab85a 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ }, "readmeFilename": "README.md", "nbbpm": { - "compatibility": "^4.12.0" + "compatibility": "^4.14.0" }, "dependencies": { "arraybuffer-to-string": "^1.0.2", diff --git a/static/templates/admin/plugins/2factor.tpl b/static/templates/admin/plugins/2factor.tpl index 898db42..3906578 100644 --- a/static/templates/admin/plugins/2factor.tpl +++ b/static/templates/admin/plugins/2factor.tpl @@ -19,26 +19,24 @@ [[2factor:admin.users.text]]

- + {{{ if users.length }}} - + {{{ else }}}
[[2factor:admin.users.none]]
- + {{{ end }}}