vuefy login page

This commit is contained in:
Johannes Zellner
2024-12-14 01:42:23 +01:00
parent 7438576bb1
commit a071cef46a
4 changed files with 306 additions and 253 deletions
+4 -8
View File
@@ -39,7 +39,6 @@ const assert = require('assert'),
safe = require('safetydance'),
settings = require('./settings.js'),
tokens = require('./tokens.js'),
translations = require('./translations.js'),
url = require('url'),
users = require('./users.js'),
groups = require('./groups.js'),
@@ -467,8 +466,6 @@ function renderInteractionPage(provider) {
assert.strictEqual(typeof provider, 'object');
return async function (req, res) {
const translationAssets = await translations.getTranslations();
try {
const { uid, prompt, params, session } = await provider.interactionDetails(req, res);
@@ -493,8 +490,7 @@ function renderInteractionPage(provider) {
}
// great ejs replacement!
const template = fs.readFileSync(__dirname + '/../dashboard/login.html', 'utf-8');
let html = translations.translate(template, translationAssets);
let html = fs.readFileSync(__dirname + '/../dashboard/dist/login.html', 'utf-8');
Object.keys(options).forEach(key => {
html = html.replaceAll(`##${key}##`, options[key]);
});
@@ -523,7 +519,7 @@ function renderInteractionPage(provider) {
data.SUBMIT_URL = `${ROUTE_PREFIX}/interaction/${uid}/${hasAccess ? 'confirm' : 'abort'}`;
let html = fs.readFileSync(path.join(__dirname, hasAccess ? '/../dashboard/oidc_interaction_confirm.html' : '/../dashboard/oidc_interaction_abort.html'), 'utf8');
let html = fs.readFileSync(path.join(__dirname, hasAccess ? '/../dashboard/dist/oidc_interaction_confirm.html' : '/../dashboard/dist/oidc_interaction_abort.html'), 'utf8');
Object.keys(data).forEach(key => {
html = html.replaceAll(`##${key}##`, data[key]);
});
@@ -541,7 +537,7 @@ function renderInteractionPage(provider) {
FOOTER: marked.parse(await branding.renderFooter())
};
let html = fs.readFileSync(path.join(__dirname, '/../dashboard/oidc_error.html'), 'utf8');
let html = fs.readFileSync(path.join(__dirname, '/../dashboard/dist/oidc_error.html'), 'utf8');
Object.keys(data).forEach(key => {
html = html.replaceAll(`##${key}##`, data[key]);
});
@@ -781,7 +777,7 @@ async function renderError(ctx, out, error) {
};
debug('renderError: %o', error);
let html = fs.readFileSync(path.join(__dirname, '/../dashboard/oidc_error.html'), 'utf8');
let html = fs.readFileSync(path.join(__dirname, '/../dashboard/dist/oidc_error.html'), 'utf8');
Object.keys(data).forEach(key => {
html = html.replaceAll(`##${key}##`, data[key]);
});