Move oidc error page into vite
This commit is contained in:
+8
-4
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user