mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 10:21:36 +03:00
af35d5986a
issue https://github.com/TryGhost/Team/issues/614 The new flag is only appearing when oauth is configured.
31 lines
1000 B
JavaScript
31 lines
1000 B
JavaScript
const ghostVersion = require('../../lib/ghost-version');
|
|
const settingsCache = require('../../services/settings/cache');
|
|
const urlUtils = require('../../../shared/url-utils');
|
|
|
|
const site = {
|
|
docName: 'site',
|
|
|
|
read: {
|
|
permissions: false,
|
|
query() {
|
|
const response = {
|
|
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
|
|
response.oauth = true;
|
|
}
|
|
|
|
return response;
|
|
}
|
|
}
|
|
};
|
|
|
|
module.exports = site;
|