lhisp-oauth-client 1.0.24 → 1.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lhisp-oauth-client",
3
- "version": "1.0.24",
3
+ "version": "1.0.25",
4
4
  "main": "src/index",
5
5
  "types": "src/index.d.ts",
6
6
  "repository": "git@bitbucket.org:leandro_costa/lhisp-oauth-client.git",
@@ -15,6 +15,7 @@ export declare class LhispOauthClient<iAccessToken extends AccessToken = AccessT
15
15
  protected senhaCertificado?: string;
16
16
  protected authScope?: string;
17
17
  protected headers?: AxiosHeaders;
18
+ protected authHeaders?: AxiosHeaders;
18
19
  protected grantType?: string;
19
20
  protected agent: https.Agent;
20
21
  protected accessToken?: iAccessToken;
@@ -47,6 +47,7 @@ class LhispOauthClient {
47
47
  }
48
48
  this.certificado = params.certificado;
49
49
  this.headers = (params.headers ? params.headers : {});
50
+ this.authHeaders = (params.authHeaders ? params.authHeaders : {});
50
51
  this.apiUrl = params.apiUrl;
51
52
  this.authUrl = params.authUrl;
52
53
  this.authScope = params.authScope;
@@ -94,10 +95,7 @@ class LhispOauthClient {
94
95
  method: "POST",
95
96
  url: this.authUrl,
96
97
  httpsAgent: this.agent,
97
- headers: {
98
- [this.authHeaderName]: this.getAuthHeaderValue(),
99
- "Content-Type": this.authContentType,
100
- },
98
+ headers: Object.assign({ [this.authHeaderName]: this.getAuthHeaderValue(), "Content-Type": this.authContentType }, this.authHeaders),
101
99
  data: {},
102
100
  };
103
101
  if (this.grantType)
@@ -14,6 +14,7 @@ export interface LhispOauthClientConstructorParams {
14
14
  authHeaderName?: string;
15
15
  tokenHeaderName?: string;
16
16
  headers?: Headers;
17
+ authHeaders?: Headers;
17
18
  grantType?: string;
18
19
  authContentType?: ContentType;
19
20
  sendAuthCredentialsOnRequestBody?: boolean;