| Env ID | ${escapeHtml(env ? env.env_id : "?")} |
| Bootstrapped at | ${escapeHtml(env ? env.bootstrapped_at : "")} |
| Issuer | ${escapeHtml(issuer)} |
@@ -148,7 +159,7 @@ const dashboard = async (req, res) => {
Signing key rotation
Generates a new active signing key (new kid). The previous key keeps verifying issued tokens (stays in JWKS as retiring) until its grace window elapses, then drops out.
`;
- res.type("text/html").send(layout("saltcorn-idp dashboard", body));
+ res.sendWrap("saltcorn-idp dashboard", layout(req, body));
} catch (e) {
// eslint-disable-next-line no-console
console.error(`[${constants.PLUGIN_NAME}] dashboard failed:`, e);
@@ -198,12 +209,12 @@ const groupsPage = async (req, res) => {
const body = `
Groups
The OIDC groups claim = each user's Saltcorn role (as role:<name>) plus these custom groups (as group:<name>).
- | Group | Members | |
${rows || '| no groups yet |
'}
+ | Group | Members | |
${rows || '| no groups yet |
'}
Create group
`;
- res.type("text/html").send(layout("saltcorn-idp groups", body));
+ res.sendWrap("saltcorn-idp groups", layout(req, body));
} catch (e) {
// eslint-disable-next-line no-console
console.error(`[${constants.PLUGIN_NAME}] groups page failed:`, e);
@@ -306,7 +317,7 @@ const clientsPage = async (req, res) => {
}
const body = `
Clients (relying parties)
- | client_id | label | auth | redirect URIs | scope | |
${rows || '| no clients yet |
'}
+ | client_id | label | auth | redirect URIs | scope | |
${rows || '| no clients yet |
'}
Register client
`;
- res.type("text/html").send(layout("saltcorn-idp clients", body));
+ res.sendWrap("saltcorn-idp clients", layout(req, body));
} catch (e) {
// eslint-disable-next-line no-console
console.error(`[${constants.PLUGIN_NAME}] clients page failed:`, e);
@@ -368,7 +379,7 @@ const createClientHandler = async (req, res) => {
Client secret (shown once - copy it now):
${escapeHtml(created.secret)}
Back to clients
`;
- res.type("text/html").send(layout("client secret", body));
+ res.sendWrap("client secret", layout(req, body));
} else {
res.redirect(constants.ADMIN_BASE_PATH + "/clients");
}
@@ -409,7 +420,7 @@ const samlSpsPage = async (req, res) => {
const body = `
SAML service providers
Only registered SPs receive assertions, and only at an allow-listed ACS URL. A signing cert enables (and "require signed" enforces) AuthnRequest signature verification.
- | entityID | label | ACS URLs | req signed | cert | |
${rows || '| no SPs yet |
'}
+ | entityID | label | ACS URLs | req signed | cert | |
${rows || '| no SPs yet |
'}
Register SP
`;
- res.type("text/html").send(layout("saltcorn-idp saml sps", body));
+ res.sendWrap("saltcorn-idp saml sps", layout(req, body));
} catch (e) {
// eslint-disable-next-line no-console
console.error(`[${constants.PLUGIN_NAME}] saml sps page failed:`, e);
@@ -512,7 +523,7 @@ const ldapListenerSection = async (req) => {
const applied = await ldapSettings.getApplied();
const effective = runtime.enabled ? `${escapeHtml(runtime.host)}:${escapeHtml(String(runtime.port))}` : "disabled";
const running = (applied && applied.enabled) ? `${escapeHtml(applied.host)}:${escapeHtml(String(applied.port))}` : "disabled";
- const statusTable = `
+ const statusTable = `
| Currently running | ${running} |
| Effective after restart | ${effective} |
`;
@@ -557,7 +568,7 @@ const ldapServicePage = async (req, res) => {
${listener}
LDAP service account
A service DN + password for the search-then-bind flow (an application binds as this DN, searches for a user, then re-binds as that user to validate the password). The password is sealed at rest and never displayed.
- | Configured service DN | ${dn ? `${escapeHtml(dn)}` : '(none)'} |
|---|
+ | Configured service DN | ${dn ? `${escapeHtml(dn)}` : '(none)'} |
|---|
Set service account
Clear
`;
- res.type("text/html").send(layout("saltcorn-idp ldap", body));
+ res.sendWrap("saltcorn-idp ldap", layout(req, body));
} catch (e) {
// eslint-disable-next-line no-console
console.error(`[${constants.PLUGIN_NAME}] ldap service page failed:`, e);