16e3c4870bdb300d9ef031d55a628e40d2f2f205
[squeep-indie-auther] / src / template / authorization-error-html.js
1 'use strict';
2
3 const th = require('./template-helper');
4 const { sessionNavLinks } = require('@squeep/authentication-module');
5
6 /**
7 *
8 * @param {Object} ctx
9 * @param {Object} ctx.session
10 * @param {String=} ctx.session.error
11 * @param {String[]=} ctx.session.errorDescriptions
12 * @param {Object} options
13 * @param {Object} options.manager
14 * @param {String} options.manager.pageTitle
15 * @param {String} options.manager.footerEntries
16 * @returns {String}
17 */
18 module.exports = (ctx, options) => {
19 const pagePathLevel = 0;
20 const htmlOptions = {
21 pageIdentifier: 'authorizationError',
22 pageTitle: options.manager.pageTitle,
23 logoUrl: options.manager.logoUrl,
24 footerEntries: options.manager.footerEntries,
25 errorContent: ctx.errorContent || ['Unknown Error'],
26 };
27 th.navLinks(pagePathLevel, ctx, htmlOptions);
28 sessionNavLinks(pagePathLevel, ctx, htmlOptions);
29 return th.htmlPage(pagePathLevel, ctx, htmlOptions, []);
30 };