From dd72e24cd7fa538b10ce02ee989e4bbadc0e1ff5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?=
Date: Sun, 14 Jun 2026 12:56:36 -0400
Subject: [PATCH] feat: udpate for 4.14.0
---
lib/controllers.js | 14 ++++++--------
package.json | 2 +-
static/templates/admin/plugins/2factor.tpl | 18 ++++++++----------
3 files changed, 15 insertions(+), 19 deletions(-)
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 }}}