diff --git a/dashboard/src/i18n.js b/dashboard/src/i18n.js index b873af4c7..8c4ad2f4e 100644 --- a/dashboard/src/i18n.js +++ b/dashboard/src/i18n.js @@ -35,15 +35,7 @@ async function main() { // load at least fallback english await loadLanguage('en'); - let locale = window.localStorage.NG_TRANSLATE_LANG_KEY; - if (!locale) { - try { - const res = await fetcher.get(`${API_ORIGIN}/api/v1/auth/branding`); - locale = res.body.language; - } catch (error) { - console.error('Failed to get branding info for translation.', error); - } - } + const locale = window.localStorage.NG_TRANSLATE_LANG_KEY || window.cloudron.language; if (locale && locale !== 'en') { await loadLanguage(locale); diff --git a/src/routes/auth.js b/src/routes/auth.js index 5ab70c09e..d2814cc2d 100644 --- a/src/routes/auth.js +++ b/src/routes/auth.js @@ -6,7 +6,6 @@ exports = module.exports = { passwordResetRequest, passwordReset, setupAccount, - getBranding }; const assert = require('assert'), @@ -116,14 +115,3 @@ async function setupAccount(req, res, next) { next(new HttpSuccess(201, { accessToken })); } - -async function getBranding(req, res, next) { - // still used in passwordreset and setupaccount views. we should server render them - const result = { - cloudronName: await branding.getCloudronName(), - footer: await branding.renderFooter(), - language: await cloudron.getLanguage(), - }; - - next(new HttpSuccess(200, result)); -} diff --git a/src/server.js b/src/server.js index 58c3dca54..e9247fcbb 100644 --- a/src/server.js +++ b/src/server.js @@ -97,7 +97,6 @@ async function initializeExpressSync() { router.post('/api/v1/auth/password_reset_request', json, routes.auth.passwordResetRequest); router.post('/api/v1/auth/password_reset', json, routes.auth.passwordReset); router.post('/api/v1/auth/setup_account', json, routes.auth.setupAccount); - router.get ('/api/v1/auth/branding', routes.auth.getBranding); // temp route until we server side render password_reset and setup_account router.get ('/api/v1/cloudron/status', routes.cloudron.getStatus); // healthcheck router.get ('/api/v1/cloudron/avatar', routes.branding.getCloudronAvatar); // public route for dashboard, email