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
Some checks failed
Build & Push Docker Image / build (push) Has been cancelled
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user