From 3cf67f7cce545e9ca221e425c6de57e8219f90cf Mon Sep 17 00:00:00 2001 From: Lennart Ochel Date: Wed, 30 Apr 2025 11:00:15 +0200 Subject: [PATCH] Dynamic App Name Loading for Auth Page (#1361) --- web/auth.html | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/web/auth.html b/web/auth.html index 1c9e1716..1f50633c 100644 --- a/web/auth.html +++ b/web/auth.html @@ -195,6 +195,28 @@ document.getElementById("login").appendChild(input); } + + // Fetch the app name from the manifest file + fetch('/.client/manifest.json') + .then(response => { + if (!response.ok) { + throw new Error('Failed to load manifest'); + } + return response.json(); + }) + .then(manifest => { + const appName = manifest.name || 'SilverBullet'; + // Update the title + document.title = `Login to ${appName}`; + // Update the header text + const header = document.querySelector('h1'); + if (header) { + header.innerHTML = `Login to ${appName}`; + } + }) + .catch(error => { + console.error('Error fetching manifest:', error); + });