diff --git a/package-lock.json b/package-lock.json index 45fed98..e443ee7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "lhisp-oauth-client", - "version": "1.0.24", + "version": "1.0.25", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "lhisp-oauth-client", - "version": "1.0.24", + "version": "1.0.25", "license": "MIT", "dependencies": { "axios": "^1.6.1", diff --git a/package.json b/package.json index 4f9850c..1156f5c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lhisp-oauth-client", - "version": "1.0.24", + "version": "1.0.25", "main": "src/index", "types": "src/index.d.ts", "repository": "git@bitbucket.org:leandro_costa/lhisp-oauth-client.git", diff --git a/src/lhisp-oauth-client.t.ts b/src/lhisp-oauth-client.t.ts index 3ad36cc..a4bf572 100644 --- a/src/lhisp-oauth-client.t.ts +++ b/src/lhisp-oauth-client.t.ts @@ -15,6 +15,7 @@ export interface LhispOauthClientConstructorParams { authHeaderName?: string; tokenHeaderName?: string; headers?: Headers; + authHeaders?: Headers; grantType?: string; authContentType?: ContentType; sendAuthCredentialsOnRequestBody?: boolean; diff --git a/src/lhisp-oauth-client.ts b/src/lhisp-oauth-client.ts index dfc7649..c26024a 100644 --- a/src/lhisp-oauth-client.ts +++ b/src/lhisp-oauth-client.ts @@ -25,6 +25,7 @@ export class LhispOauthClient { protected senhaCertificado?: string; protected authScope?: string; protected headers?: AxiosHeaders; + protected authHeaders?: AxiosHeaders; protected grantType?: string; protected agent: https.Agent; protected accessToken?: iAccessToken; @@ -49,6 +50,7 @@ export class LhispOauthClient { this.certificado = params.certificado; this.headers = (params.headers ? params.headers : {}) as any as AxiosHeaders; + this.authHeaders = (params.authHeaders ? params.authHeaders : {}) as any as AxiosHeaders; this.apiUrl = params.apiUrl; this.authUrl = params.authUrl; this.authScope = params.authScope; @@ -101,6 +103,7 @@ export class LhispOauthClient { headers: { [this.authHeaderName]: this.getAuthHeaderValue(), "Content-Type": this.authContentType, + ...this.authHeaders, }, data: {}, };