Skip to content
This repository was archived by the owner on Jan 20, 2024. It is now read-only.

Commit 3374463

Browse files
committed
Merge branch 'master' of github.com:mulesoft/js-client-oauth2
2 parents 3281f6f + eb474e6 commit 3374463

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/client-oauth2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ TokenFlow.prototype.getToken = function (uri, opts) {
470470

471471
// If no query string or fragment exists, we won't be able to parse
472472
// any useful information from the uri.
473-
if (!url.hash && !url.query) {
473+
if (!url.hash && !url.search) {
474474
return Promise.reject(new TypeError('Unable to process uri: ' + uri))
475475
}
476476

test/token.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,14 @@ describe('token', function () {
4747
})
4848
})
4949
})
50+
51+
it('should fail if token not present', function (done) {
52+
githubAuth.token.getToken(config.redirectUri)
53+
.then(function (ignore) {
54+
done(new Error('Promise should fail'))
55+
}, function (reason) {
56+
done() // Promise is rejected - pass
57+
})
58+
})
5059
})
5160
})

0 commit comments

Comments
 (0)