diff --git a/dashboard/login.html b/dashboard/login.html index 7cda2dac8..45b91a28e 100644 --- a/dashboard/login.html +++ b/dashboard/login.html @@ -1,255 +1,37 @@ - - - - - - {{ login.loginTo }} ##NAME## + + + + + ##NAME## + + + - - - - - -
-
-
-
-
- -
- {{ login.loginTo }} -

##NAME##

-
-
-
-
-
- ##NOTE## -
-
- - -
-
- - -

{{ login.errorIncorrectCredentials }}

-

{{ login.errorInternal }}

-
-
- - -

{{ login.errorIncorrect2FAToken }}

-
-
- {{ login.resetPasswordAction }} - -
-
-
-
-
-
- - -
- - - - + + + +
+ + diff --git a/dashboard/src/components/Login.vue b/dashboard/src/components/Login.vue new file mode 100644 index 000000000..13a3fd8f6 --- /dev/null +++ b/dashboard/src/components/Login.vue @@ -0,0 +1,259 @@ + + + + + + diff --git a/dashboard/src/login.js b/dashboard/src/login.js new file mode 100644 index 000000000..c9005c94c --- /dev/null +++ b/dashboard/src/login.js @@ -0,0 +1,16 @@ +import { createApp } from 'vue'; + +import './style.css'; + +import '@fontsource/noto-sans'; + +import i18n from './i18n.js'; +import Login from './components/Login.vue'; + +(async function init() { + const app = createApp(Login); + + app.use(await i18n()); + + app.mount('#app'); +})(); diff --git a/src/oidc.js b/src/oidc.js index 07302dcbb..0d8cb812f 100644 --- a/src/oidc.js +++ b/src/oidc.js @@ -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]); });