0
Fork 0
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:
Aileen Nowak 2016-11-02 19:02:32 +07:00 committed by Katharina Irrgang
parent ad9b59c87c
commit 3cb38ad01c

View file

@ -31,7 +31,7 @@ _private.registerClient = function (options) {
debug('Update ghost client callback url...');
return ghostOAuth2Strategy.changeCallbackURL({
callbackURL: url + '/ghost/',
callbackURL: utils.url.urlJoin(url, 'ghost', '/'),
clientId: client.get('uuid'),
clientSecret: client.get('secret')
}).then(function changedCallbackURL() {
@ -52,7 +52,7 @@ _private.registerClient = function (options) {
slug: 'ghost-auth',
uuid: credentials.client_id,
secret: credentials.client_secret,
redirection_uri: url + '/ghost/'
redirection_uri: utils.url.urlJoin(url, 'ghost', '/')
}, {context: {internal: true}});
})
.then(function returnClient(client) {
@ -111,7 +111,7 @@ exports.init = function initPassport(options) {
}
var ghostOAuth2Strategy = new GhostOAuth2Strategy({
callbackURL: utils.url.getBaseUrl() + '/ghost/',
callbackURL: utils.url.urlJoin(utils.url.getBaseUrl(), 'ghost', '/'),
url: url,
passReqToCallback: true
}, authStrategies.ghostStrategy);