v0.10.3 ui changes and bug fixes
This commit is contained in:
@@ -39,6 +39,15 @@ router.get('/', async (req, res) => {
|
||||
if (admin) obj.admin_email = admin.email;
|
||||
obj.app_version = process.env.JAMA_VERSION || 'dev';
|
||||
obj.user_pass = process.env.USER_PASS || 'user@1234';
|
||||
// Tell the frontend whether this request came from the HOST_DOMAIN.
|
||||
// Used to show/hide the Control Panel menu item — only visible on the host's own domain.
|
||||
const reqHost = (req.headers.host || '').toLowerCase().split(':')[0];
|
||||
const hostDomain = (process.env.HOST_DOMAIN || '').toLowerCase();
|
||||
obj.is_host_domain = (
|
||||
process.env.APP_TYPE === 'host' &&
|
||||
!!hostDomain &&
|
||||
(reqHost === hostDomain || reqHost === `www.${hostDomain}` || reqHost === 'localhost')
|
||||
) ? 'true' : 'false';
|
||||
res.json({ settings: obj });
|
||||
} catch (e) { res.status(500).json({ error: e.message }); }
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user