diff --git a/package.json b/package.json index 8ddec11..27bb6b6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lhisp-oauth-client-dev", - "version": "1.0.32", + "version": "1.0.33", "main": "src/index", "types": "src/index.d.ts", "repository": { diff --git a/src/lhisp-oauth-client.ts b/src/lhisp-oauth-client.ts index 54816b7..a9f3e64 100644 --- a/src/lhisp-oauth-client.ts +++ b/src/lhisp-oauth-client.ts @@ -151,6 +151,10 @@ export class LhispOauthClient { return this.formatAccessToken(this.accessToken); } + if (!this.accessToken) { + throw new Error("Access Token não disponível."); + } + return `${this.accessToken?.token_type} ${this.accessToken?.access_token}`; }