X-Git-Url: https://git.squeep.com/?p=squeep-authentication-module;a=blobdiff_plain;f=lib%2Ftemplate%2Fia-html.js;fp=lib%2Ftemplate%2Fia-html.js;h=8a27479eb8426e4a3df658f9b71d382414754556;hp=5de476ae04b880d2d94e6e3b1bd3db359aee2095;hb=2c3ddf0a6f40b9d0a4e54fa12b84b8af33eaaadc;hpb=54ca04e330d14a12344ddc2b161c1d9b55bfd7d7 diff --git a/lib/template/ia-html.js b/lib/template/ia-html.js index 5de476a..8a27479 100644 --- a/lib/template/ia-html.js +++ b/lib/template/ia-html.js @@ -1,6 +1,7 @@ 'use strict'; const { TemplateHelper: th } = require('@squeep/html-template-helper'); +const { sessionNavLinks } = require('./helpers'); /** * @@ -23,10 +24,13 @@ function mainContent() { * @param {String} options.manager.pageTitle * @param {Object} options.dingus * @param {String} options.dingus.selfBaseUrl + * @param {(pagePathLevel, ctx, htmlOptions) => {void}} appCb * @returns {String} */ -module.exports = (ctx, options) => { +module.exports = (ctx, options, appCb = () => {}) => { + const pagePathLevel = 1; const htmlOptions = { + pageIdentifier: 'indieAuthError', pageTitle: options.manager.pageTitle, logoUrl: options.manager.logoUrl, footerEntries: options.manager.footerEntries, @@ -34,11 +38,14 @@ module.exports = (ctx, options) => { '

Problems were encountered while trying to authenticate your profile URL.

', ], }; + appCb(pagePathLevel, ctx, htmlOptions); + sessionNavLinks(pagePathLevel, ctx, htmlOptions); + // Ensure there is always an error to report, even if we do not have one, as we ended up here somehow. if (!ctx?.errors?.length) { ctx.errors = [ 'Unknown Error — we are not sure what just happened', ]; } - return th.htmlPage(2, ctx, htmlOptions, mainContent()); + return th.htmlPage(pagePathLevel, ctx, htmlOptions, mainContent()); }; \ No newline at end of file