Move oidc error page into vite

This commit is contained in:
Johannes Zellner
2024-12-13 23:02:31 +01:00
parent d9402bc24d
commit 8dd4b58227
3 changed files with 11 additions and 6 deletions
+8 -4
View File
@@ -497,7 +497,7 @@ function renderInteractionPage(provider) {
const template = fs.readFileSync(__dirname + '/../dashboard/login.html', 'utf-8');
let html = translations.translate(template, translationAssets);
Object.keys(options).forEach(key => {
html = html.replace(`##${key}##`, options[key], 'g');
html = html.replaceAll(`##${key}##`, options[key]);
});
return res.send(html);
@@ -763,14 +763,18 @@ async function findAccount(ctx, id) {
async function renderError(ctx, out, error) {
const data = {
errorMessage: error.error_description || error.error_detail || 'Unknown error',
footer: marked.parse(await branding.renderFooter())
ERROR_MESSAGE: error.error_description || error.error_detail || 'Unknown error',
FOOTER: marked.parse(await branding.renderFooter())
};
debug('renderError: %o', error);
let html = fs.readFileSync(path.join(__dirname, '/..dashboard/oidc_error.html'), 'utf8');
Object.keys(data).forEach(key => {
html = html.replaceAll(`##${key}##`, data[key]);
});
ctx.type = 'html';
ctx.body = ejs.render(fs.readFileSync(path.join(__dirname, 'oidc_templates/error.ejs'), 'utf8'), data, {});
ctx.body = html;
}
async function start() {