mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Updates for alpha.13 (#8026)
* 🐛 delete client if auth url has changed no issue * 🎨 update default auth config refs #7488
This commit is contained in:
parent
6880199767
commit
aa670fa8b4
5 changed files with 18 additions and 6 deletions
|
@ -91,11 +91,18 @@ _private.updateClient = function updateClient(options) {
|
|||
});
|
||||
}
|
||||
|
||||
// CASE: auth url has changed, create client
|
||||
if (client.get('auth_uri') !== ghostOAuth2Strategy.url) {
|
||||
return models.Client.destroy({id: client.id})
|
||||
.then(function () {
|
||||
return _private.updateClient(options);
|
||||
});
|
||||
}
|
||||
|
||||
// CASE: nothing changed
|
||||
if (client.get('redirection_uri') === redirectUri &&
|
||||
client.get('name') === clientName &&
|
||||
client.get('description') === clientDescription &&
|
||||
client.get('auth_uri') === ghostOAuth2Strategy.url &&
|
||||
client.get('client_uri') === clientUri) {
|
||||
debug('Client did not change');
|
||||
|
||||
|
|
|
@ -16,10 +16,6 @@
|
|||
"scheduling": {
|
||||
"active": "SchedulingDefault"
|
||||
},
|
||||
"auth": {
|
||||
"type": "ghost",
|
||||
"url": "http://devauth.ghost.org:8080"
|
||||
},
|
||||
"logging": {
|
||||
"level": "info",
|
||||
"rotation": {
|
||||
|
|
|
@ -7,6 +7,10 @@
|
|||
},
|
||||
"debug": false
|
||||
},
|
||||
"auth": {
|
||||
"type": "ghost",
|
||||
"url": "http://devauth.ghost.org:8080"
|
||||
},
|
||||
"paths": {
|
||||
"contentPath": "content/"
|
||||
},
|
||||
|
|
|
@ -9,6 +9,10 @@
|
|||
"database" : "ghost"
|
||||
}
|
||||
},
|
||||
"auth": {
|
||||
"type": "ghost",
|
||||
"url": "https://auth.ghost.org"
|
||||
},
|
||||
"paths": {
|
||||
"contentPath": "content/"
|
||||
},
|
||||
|
|
|
@ -19,6 +19,7 @@ describe('Configuration API', function () {
|
|||
|
||||
it('can read basic config and get all expected properties', function (done) {
|
||||
configUtils.set('auth:type', 'ghost');
|
||||
configUtils.set('auth:url', 'https://auth.ghost.com');
|
||||
|
||||
ConfigurationAPI.read().then(function (response) {
|
||||
var props;
|
||||
|
@ -44,7 +45,7 @@ describe('Configuration API', function () {
|
|||
props.publicAPI.should.eql(false);
|
||||
props.clientId.should.eql('ghost-admin');
|
||||
props.clientSecret.should.eql('not_available');
|
||||
props.ghostAuthUrl.should.eql('http://devauth.ghost.org:8080');
|
||||
props.ghostAuthUrl.should.eql('https://auth.ghost.com');
|
||||
|
||||
// value not available, because settings API was not called yet
|
||||
props.hasOwnProperty('blogTitle').should.eql(true);
|
||||
|
|
Loading…
Add table
Reference in a new issue