mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
Removed client credentials from Admin API v2 (#10485)
refs #10438 - v2 does not use client credentials anymore - exception: scheduler & backup clients
This commit is contained in:
parent
ae437a89dd
commit
90c421a8a8
2 changed files with 1 additions and 12 deletions
|
@ -1,7 +1,6 @@
|
||||||
const Promise = require('bluebird');
|
const Promise = require('bluebird');
|
||||||
const {isPlainObject} = require('lodash');
|
const {isPlainObject} = require('lodash');
|
||||||
const urlService = require('../../services/url');
|
const urlService = require('../../services/url');
|
||||||
const models = require('../../models');
|
|
||||||
const config = require('../../config');
|
const config = require('../../config');
|
||||||
const labs = require('../../services/labs');
|
const labs = require('../../services/labs');
|
||||||
const settingsCache = require('../../services/settings/cache');
|
const settingsCache = require('../../services/settings/cache');
|
||||||
|
@ -41,15 +40,7 @@ module.exports = {
|
||||||
],
|
],
|
||||||
query({data}) {
|
query({data}) {
|
||||||
if (!data.key) {
|
if (!data.key) {
|
||||||
return models.Client.findOne({slug: 'ghost-admin'})
|
return Promise.resolve(getBaseConfig());
|
||||||
.then((ghostAdmin) => {
|
|
||||||
const configuration = getBaseConfig();
|
|
||||||
|
|
||||||
configuration.clientId = ghostAdmin.get('slug');
|
|
||||||
configuration.clientSecret = ghostAdmin.get('secret');
|
|
||||||
|
|
||||||
return configuration;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.key === 'about') {
|
if (data.key === 'about') {
|
||||||
|
|
|
@ -37,8 +37,6 @@ describe('Configuration API', function () {
|
||||||
props.blogUrl.should.eql('http://127.0.0.1:2369/');
|
props.blogUrl.should.eql('http://127.0.0.1:2369/');
|
||||||
|
|
||||||
props.useGravatar.should.eql(false);
|
props.useGravatar.should.eql(false);
|
||||||
props.clientId.should.eql('ghost-admin');
|
|
||||||
props.clientSecret.should.eql('not_available');
|
|
||||||
|
|
||||||
// value not available, because settings API was not called yet
|
// value not available, because settings API was not called yet
|
||||||
props.hasOwnProperty('blogTitle').should.eql(true);
|
props.hasOwnProperty('blogTitle').should.eql(true);
|
||||||
|
|
Loading…
Add table
Reference in a new issue