feat: implement hide app name feature with toggle in admin settings and update branding context
Some checks failed
Build & Push Docker Image / build (push) Has been cancelled

This commit is contained in:
2026-03-04 10:11:35 +01:00
parent bac4e8ae7c
commit ce2cf499dc
11 changed files with 627 additions and 61 deletions

View File

@@ -108,6 +108,8 @@ router.get('/', async (req, res) => {
}
} catch { /* not configured */ }
const hideAppName = await getSetting('hide_app_name');
res.json({
appName: appName || 'Redlight',
hasLogo: !!logoFile,
@@ -118,6 +120,7 @@ router.get('/', async (req, res) => {
privacyUrl: privacyUrl || null,
oauthEnabled,
oauthDisplayName,
hideAppName: hideAppName === 'true',
});
} catch (err) {
log.branding.error('Get branding error:', err);
@@ -282,4 +285,23 @@ router.put('/privacy-url', authenticateToken, requireAdmin, async (req, res) =>
}
});
// PUT /api/branding/hide-app-name - Toggle app name visibility (admin only)
router.put('/hide-app-name', authenticateToken, requireAdmin, async (req, res) => {
try {
const { hideAppName } = req.body;
if (typeof hideAppName !== 'boolean') {
return res.status(400).json({ error: 'hideAppName must be a boolean' });
}
if (hideAppName) {
await setSetting('hide_app_name', 'true');
} else {
await deleteSetting('hide_app_name');
}
res.json({ hideAppName });
} catch (err) {
log.branding.error('Update hide app name error:', err);
res.status(500).json({ error: 'Could not update setting' });
}
});
export default router;