From 3cb38ad01cf660800ff91b95a3b917f2a7d13066 Mon Sep 17 00:00:00 2001 From: Aileen Nowak Date: Wed, 2 Nov 2016 19:02:32 +0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=20Fix=20URL=20mismatch=20error?= =?UTF-8?q?=20for=20redirect=5Furi=20(#7663)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes #7656 Uses `urlJoin` to create `redirect_uri` rather then concatenating url + `/ghost/` which produced a double `/` in the url. --- core/server/auth/passport.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/server/auth/passport.js b/core/server/auth/passport.js index 8d101e8da0..3081e42c15 100644 --- a/core/server/auth/passport.js +++ b/core/server/auth/passport.js @@ -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);