File tree 2 files changed +3
-6
lines changed
2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change 2
2
3
3
var request = require ( 'request' ) ;
4
4
var q = require ( 'q' ) ;
5
+ var sdkPackage = require ( '../package.json' ) ;
5
6
6
7
function GnAuth ( options , constants ) {
7
8
this . constants = constants ;
8
9
this . clientId = options . client_id ;
9
10
this . clientSecret = options . client_secret ;
10
11
this . baseUrl = options . baseUrl ;
11
- this . sdkHeader = options . sdkHeader ;
12
12
}
13
13
14
14
GnAuth . prototype . getAccessToken = function ( ) {
@@ -18,7 +18,7 @@ GnAuth.prototype.getAccessToken = function() {
18
18
url : this . baseUrl + this . constants . ENDPOINTS . authorize . route ,
19
19
json : true ,
20
20
headers : {
21
- 'api-sdk' : this . sdkHeader
21
+ 'api-sdk' : 'node-' + sdkPackage . version
22
22
} ,
23
23
body : {
24
24
grant_type : 'client_credentials'
Original file line number Diff line number Diff line change @@ -7,9 +7,6 @@ var sdkPackage = require('../package.json');
7
7
8
8
function GnEndpoints ( options , constants ) {
9
9
options . baseUrl = options . sandbox ? constants . URL . sandbox : constants . URL . production ;
10
- if ( ! options . sdkHeader ) {
11
- options . sdkHeader = 'node-' + sdkPackage . version ;
12
- }
13
10
this . options = options ;
14
11
this . gnAuth = new GnAuth ( options , constants ) ;
15
12
this . accessToken = null ;
@@ -107,7 +104,7 @@ GnEndpoints.prototype.getParams = function(route) {
107
104
url : [ this . options . baseUrl , route , query ] . join ( '' ) ,
108
105
json : true ,
109
106
headers : {
110
- 'api-sdk' : self . options . sdkHeader
107
+ 'api-sdk' : 'node-' + sdkPackage . version
111
108
} ,
112
109
body : this . body
113
110
} ;
You can’t perform that action at this time.
0 commit comments