mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
no issue - moved `config` and `site` API output generation to a `public-config` service allowing all API versions to use `publicConfig.config` or `publicConfig.site` in their query methods - updated `config` and `site` API output serializers to use an allow-list that limits the data returned for each API version
22 lines
808 B
JavaScript
22 lines
808 B
JavaScript
const ghostVersion = require('../../lib/ghost-version');
|
|
const settingsCache = require('../settings/cache');
|
|
const urlUtils = require('../../../shared/url-utils');
|
|
|
|
module.exports = function getSiteProperties() {
|
|
const siteProperties = {
|
|
title: settingsCache.get('title'),
|
|
description: settingsCache.get('description'),
|
|
logo: settingsCache.get('logo'),
|
|
icon: settingsCache.get('icon'),
|
|
accent_color: settingsCache.get('accent_color'),
|
|
url: urlUtils.urlFor('home', true),
|
|
version: ghostVersion.safe
|
|
};
|
|
|
|
if (settingsCache.get('oauth_client_id') && settingsCache.get('oauth_client_secret')) {
|
|
// Only set the oauth flag if oauth is enabled to avoid API changes
|
|
siteProperties.oauth = true;
|
|
}
|
|
|
|
return siteProperties;
|
|
};
|