diff --git a/src/client-oauth2.js b/src/client-oauth2.js index 612d6e2..9cde167 100644 --- a/src/client-oauth2.js +++ b/src/client-oauth2.js @@ -582,16 +582,6 @@ CodeFlow.prototype.getToken = function (uri, opts) { var url = typeof uri === 'object' ? uri : Url.parse(uri, true) - if ( - typeof options.redirectUri === 'string' && - typeof url.pathname === 'string' && - url.pathname !== Url.parse(options.redirectUri).pathname - ) { - return Promise.reject( - new TypeError('Redirected path should match configured path, but got: ' + url.pathname) - ) - } - if (!url.query) { return Promise.reject(new TypeError('Unable to process uri: ' + uri)) } diff --git a/test/code.js b/test/code.js index f309e3d..a21afd8 100644 --- a/test/code.js +++ b/test/code.js @@ -36,6 +36,15 @@ describe('code', function () { }) }) + it('uri pathname and redirectUri pathname should not have to match', function () { + return githubAuth.code.getToken(uri, { + redirectUri: config.redirectUri + '/someOtherJunk' + }) + .then(function (user) { + expect(user.accessToken).to.equal(config.accessToken) + }) + }) + it('should reject with auth errors', function () { var errored = false