From 12e5171f8786254da4e33e2f05a784aed0429289 Mon Sep 17 00:00:00 2001 From: Antoine Nguyen Date: Thu, 31 Jul 2025 10:21:58 +0200 Subject: [PATCH] Added possibility to customize HTML page title in frontend app --- frontend/public/config.json | 1 + frontend/src/router/index.js | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/frontend/public/config.json b/frontend/public/config.json index e5b707031..82d9f9940 100644 --- a/frontend/public/config.json +++ b/frontend/public/config.json @@ -5,5 +5,6 @@ "OAUTH_CLIENT_ID": "LVQbfIIX3khWR3nDvix1u9yEGHZUxcx53bhJ7FlD", "OAUTH_REDIRECT_URI": "/login/logged", "OAUTH_POST_REDIRECT_URI": "/", + "HTML_PAGE_TITLE": "Test title", "MENU_LOGO_PATH": "src/assets/Modoboa_RVB-BLANC-SANS.png" } diff --git a/frontend/src/router/index.js b/frontend/src/router/index.js index f0bd9457f..5a5ca046c 100644 --- a/frontend/src/router/index.js +++ b/frontend/src/router/index.js @@ -1,5 +1,6 @@ import { createRouter, createWebHistory } from 'vue-router' import { useAuthStore } from '@/stores' +import { useGlobalConfig } from '@/main' import constants from '@/constants.json' const routes = [ @@ -440,6 +441,11 @@ const router = createRouter({ }) router.beforeEach(async (to, from, next) => { + const config = useGlobalConfig() + + document.title = config.HTML_PAGE_TITLE + ? config.HTML_PAGE_TITLE + : 'Welcome to Modoboa' if (to.meta.requiresAuth !== undefined) { const previousPage = window.location.href sessionStorage.setItem('previousPage', previousPage)