@@ -2,7 +2,7 @@ var Buffer = require('safe-buffer').Buffer
2
2
var Querystring = require ( 'querystring' )
3
3
var defaultRequest = require ( './request' )
4
4
5
- const URL_BASE = 'https://example.org/'
5
+ const DEFAULT_URL_BASE = 'https://example.org/'
6
6
7
7
var btoa
8
8
if ( typeof Buffer === 'function' ) {
@@ -465,8 +465,8 @@ TokenFlow.prototype.getUri = function (opts) {
465
465
*/
466
466
TokenFlow . prototype . getToken = function ( uri , opts ) {
467
467
var options = Object . assign ( { } , this . client . options , opts )
468
- var url = typeof uri === 'object' ?uri :new URL ( uri , URL_BASE )
469
- var expectedUrl = new URL ( options . redirectUri , URL_BASE )
468
+ var url = typeof uri === 'object' ?uri :new URL ( uri , DEFAULT_URL_BASE )
469
+ var expectedUrl = new URL ( options . redirectUri , DEFAULT_URL_BASE )
470
470
471
471
if ( typeof url . pathname === 'string' && url . pathname !== expectedUrl . pathname ) {
472
472
return Promise . reject (
@@ -581,12 +581,12 @@ CodeFlow.prototype.getToken = function (uri, opts) {
581
581
582
582
expects ( options , 'clientId' , 'accessTokenUri' )
583
583
584
- var url = typeof uri === 'object' ?uri :new URL ( uri , URL_BASE )
584
+ var url = typeof uri === 'object' ?uri :new URL ( uri , DEFAULT_URL_BASE )
585
585
586
586
if (
587
587
typeof options . redirectUri === 'string' &&
588
588
typeof url . pathname === 'string' &&
589
- url . pathname !== ( new URL ( options . redirectUri , URL_BASE ) ) . pathname
589
+ url . pathname !== ( new URL ( options . redirectUri , DEFAULT_URL_BASE ) ) . pathname
590
590
) {
591
591
return Promise . reject (
592
592
new TypeError ( 'Redirected path should match configured path, but got: ' + url . pathname )