mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
🐛 Fix URL mismatch error for redirect_uri (#7663)
closes #7656 Uses `urlJoin` to create `redirect_uri` rather then concatenating url + `/ghost/` which produced a double `/` in the url.
This commit is contained in:
parent
ad9b59c87c
commit
3cb38ad01c
1 changed files with 3 additions and 3 deletions
|
@ -31,7 +31,7 @@ _private.registerClient = function (options) {
|
||||||
|
|
||||||
debug('Update ghost client callback url...');
|
debug('Update ghost client callback url...');
|
||||||
return ghostOAuth2Strategy.changeCallbackURL({
|
return ghostOAuth2Strategy.changeCallbackURL({
|
||||||
callbackURL: url + '/ghost/',
|
callbackURL: utils.url.urlJoin(url, 'ghost', '/'),
|
||||||
clientId: client.get('uuid'),
|
clientId: client.get('uuid'),
|
||||||
clientSecret: client.get('secret')
|
clientSecret: client.get('secret')
|
||||||
}).then(function changedCallbackURL() {
|
}).then(function changedCallbackURL() {
|
||||||
|
@ -52,7 +52,7 @@ _private.registerClient = function (options) {
|
||||||
slug: 'ghost-auth',
|
slug: 'ghost-auth',
|
||||||
uuid: credentials.client_id,
|
uuid: credentials.client_id,
|
||||||
secret: credentials.client_secret,
|
secret: credentials.client_secret,
|
||||||
redirection_uri: url + '/ghost/'
|
redirection_uri: utils.url.urlJoin(url, 'ghost', '/')
|
||||||
}, {context: {internal: true}});
|
}, {context: {internal: true}});
|
||||||
})
|
})
|
||||||
.then(function returnClient(client) {
|
.then(function returnClient(client) {
|
||||||
|
@ -111,7 +111,7 @@ exports.init = function initPassport(options) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var ghostOAuth2Strategy = new GhostOAuth2Strategy({
|
var ghostOAuth2Strategy = new GhostOAuth2Strategy({
|
||||||
callbackURL: utils.url.getBaseUrl() + '/ghost/',
|
callbackURL: utils.url.urlJoin(utils.url.getBaseUrl(), 'ghost', '/'),
|
||||||
url: url,
|
url: url,
|
||||||
passReqToCallback: true
|
passReqToCallback: true
|
||||||
}, authStrategies.ghostStrategy);
|
}, authStrategies.ghostStrategy);
|
||||||
|
|
Loading…
Add table
Reference in a new issue