diff --git a/packages/meteorid/meteorid_client.js b/packages/meteorid/meteorid_client.js index a322c53723..bf935b1742 100644 --- a/packages/meteorid/meteorid_client.js +++ b/packages/meteorid/meteorid_client.js @@ -21,7 +21,7 @@ MeteorId.requestCredential = function (credentialRequestCompleteCallback) { "state=" + credentialToken + "&response_type=code&" + "client_id=" + config.clientId + - "&redirect_uri=" + Meteor.absoluteUrl("_oauth/meteorId/close"); + "&redirect_uri=" + Meteor.absoluteUrl("_oauth/meteorId?close"); Oauth.showPopup( loginUrl, diff --git a/packages/meteorid/meteorid_server.js b/packages/meteorid/meteorid_server.js index 3b02b6c602..a67a7d15fa 100644 --- a/packages/meteorid/meteorid_server.js +++ b/packages/meteorid/meteorid_server.js @@ -44,7 +44,7 @@ var getTokens = function (query) { code: query.code, client_id: config.clientId, client_secret: config.secret, - redirect_uri: Meteor.absoluteUrl("_oauth/meteorId/close") + redirect_uri: Meteor.absoluteUrl("_oauth/meteorId?close") } } ); diff --git a/packages/oauth/oauth_server.js b/packages/oauth/oauth_server.js index a54f75e791..23cc1f3e18 100644 --- a/packages/oauth/oauth_server.js +++ b/packages/oauth/oauth_server.js @@ -132,36 +132,13 @@ middleware = function (req, res, next) { OauthTest.middleware = middleware; -// Handle /_oauth/* paths and extract the service name. Hack: If we find a -// + path, extract the action and put it into -// req.query. These paths are used for services that don't allow query -// parameters in redirect_uris. +// Handle /_oauth/* paths and extract the service name. // // @returns {String|null} e.g. "facebook", or null if this isn't an // oauth request var oauthServiceName = function (req) { - // req.url will be "/_oauth/?", or for services that - // don't support query parameters in req.url (*cough*meteoraccounts*cough*), - // "/". - var barePath; - var url = req.url; - var questionIndex = url.indexOf("?"); - var slashIndex = url.indexOf("/", - url.indexOf("/_oauth/") + "/_oauth/".length); - if (slashIndex !== -1 && - (questionIndex === -1 || questionIndex > slashIndex)) { - barePath = url.substring(0, slashIndex); - var action = url.substring( - slashIndex + 1, - questionIndex === -1 ? undefined : questionIndex - ); - if (action) - req.query[action] = true; - } else if (questionIndex !== -1) { - barePath = url.substring(0, questionIndex); - } else { - barePath = url; - } + // req.url will be "/_oauth/?" + var barePath = req.url.substring(0, req.url.indexOf('?')); var splitPath = barePath.split('/'); // Any non-oauth request will continue down the default