0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Fixed incorrect return value for publicAPI from the configuration endpoint

no issue

- discovered while coding
- the value was always false, because we've tried to read the value from the config object
- the value lives in the database and is accessible via the labs service
This commit is contained in:
kirrg001 2018-05-31 15:14:59 +02:00
parent aecda1e7d6
commit af5717762d
2 changed files with 4 additions and 3 deletions

View file

@ -5,6 +5,7 @@ var Promise = require('bluebird'),
urlService = require('../services/url'),
models = require('../models'),
config = require('../config'),
labs = require('../services/labs'),
settingsCache = require('../services/settings/cache'),
ghostVersion = require('../lib/ghost-version'),
configuration;
@ -26,7 +27,7 @@ function getAboutConfig() {
function getBaseConfig() {
return {
useGravatar: !config.isPrivacyDisabled('useGravatar'),
publicAPI: config.get('publicAPI') === true,
publicAPI: labs.isSet('publicAPI'),
blogUrl: urlService.utils.urlFor('home', true),
blogTitle: settingsCache.get('title'),
clientExtensions: config.get('clientExtensions'),

View file

@ -9,7 +9,7 @@ var should = require('should'),
describe('Configuration API', function () {
// Keep the DB clean
before(testUtils.teardown);
beforeEach(testUtils.setup('clients'));
beforeEach(testUtils.setup('clients', 'settings'));
afterEach(function () {
configUtils.restore();
return testUtils.teardown();
@ -29,7 +29,7 @@ describe('Configuration API', function () {
props.blogUrl.should.eql('http://127.0.0.1:2369/');
props.useGravatar.should.eql(false);
props.publicAPI.should.eql(false);
props.publicAPI.should.eql(true);
props.clientId.should.eql('ghost-admin');
props.clientSecret.should.eql('not_available');