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:
parent
aecda1e7d6
commit
af5717762d
2 changed files with 4 additions and 3 deletions
|
@ -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'),
|
||||
|
|
|
@ -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');
|
||||
|
||||
|
|
Loading…
Reference in a new issue