3 const { TemplateHelper: th
} = require('@squeep/html-template-helper');
4 const { sessionNavLinks
} = require('./helpers');
10 function mainContent() {
13 \t<a href="./login">Try Again?</a>
19 * Render any errors from attempting IndieAuth.
21 * @param {String[]} ctx.errors
22 * @param {Object} options
23 * @param {Object} options.manager
24 * @param {String} options.manager.pageTitle
25 * @param {Object} options.dingus
26 * @param {String} options.dingus.selfBaseUrl
27 * @param {(pagePathLevel, ctx, htmlOptions) => {void}} appCb
30 module
.exports
= (ctx
, options
, appCb
= () => {}) => {
31 const pagePathLevel
= 1;
33 pageIdentifier: 'indieAuthError',
34 pageTitle: options
.manager
.pageTitle
,
35 logoUrl: options
.manager
.logoUrl
,
36 footerEntries: options
.manager
.footerEntries
,
38 '<p>Problems were encountered while trying to authenticate your profile URL.</p>',
41 appCb(pagePathLevel
, ctx
, htmlOptions
);
42 sessionNavLinks(pagePathLevel
, ctx
, htmlOptions
);
44 // Ensure there is always an error to report, even if we do not have one, as we ended up here somehow.
45 if (!ctx
?.errors
?.length
) {
47 'Unknown Error — we are not sure what just happened',
50 return th
.htmlPage(pagePathLevel
, ctx
, htmlOptions
, mainContent());