0
Fork 0
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:
Katharina Irrgang 2017-02-18 17:23:35 +01:00 committed by GitHub
parent 6880199767
commit aa670fa8b4
5 changed files with 18 additions and 6 deletions

View file

@ -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');

View file

@ -16,10 +16,6 @@
"scheduling": {
"active": "SchedulingDefault"
},
"auth": {
"type": "ghost",
"url": "http://devauth.ghost.org:8080"
},
"logging": {
"level": "info",
"rotation": {

View file

@ -7,6 +7,10 @@
},
"debug": false
},
"auth": {
"type": "ghost",
"url": "http://devauth.ghost.org:8080"
},
"paths": {
"contentPath": "content/"
},

View file

@ -9,6 +9,10 @@
"database" : "ghost"
}
},
"auth": {
"type": "ghost",
"url": "https://auth.ghost.org"
},
"paths": {
"contentPath": "content/"
},

View file

@ -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);