diff --git a/package-lock.json b/package-lock.json index f113679..ed0b410 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "lhisp-oauth-client", - "version": "1.0.16", + "version": "1.0.17", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "lhisp-oauth-client", - "version": "1.0.16", + "version": "1.0.17", "license": "MIT", "dependencies": { "axios": "^1.4.0", diff --git a/package.json b/package.json index 0fcac67..9115487 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lhisp-oauth-client", - "version": "1.0.16", + "version": "1.0.17", "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.ts b/src/lhisp-oauth-client.ts index a8920e1..213d8b4 100644 --- a/src/lhisp-oauth-client.ts +++ b/src/lhisp-oauth-client.ts @@ -21,7 +21,7 @@ export class LhispOauthClient { protected authHeaderName: string; protected tokenHeaderName: string; protected authContentType: ContentType; - protected certificado?: string; + protected certificado?: string | Buffer; protected senhaCertificado?: string; protected authScope?: string; protected headers?: Headers; @@ -36,7 +36,7 @@ export class LhispOauthClient { constructor(params: LhispOauthClientConstructorParams) { if (params.certificado) { this.agent = new https.Agent({ - pfx: params.certificado, + pfx: Buffer.isBuffer(params.certificado) ? params.certificado : Buffer.from(params.certificado, "base64"), passphrase: params.senhaCertificado, rejectUnauthorized: false, });