lhisp-oauth-client 1.0.30 → 1.0.32

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.30",
3
+ "version": "1.0.32",
4
4
  "main": "src/index",
5
5
  "types": "src/index.d.ts",
6
6
  "repository": {
@@ -117,6 +117,10 @@ class LhispOauthClient {
117
117
  contentType: this.authContentType,
118
118
  });
119
119
  const resp = yield axios_1.default.request(authRequestOpt);
120
+ if (!(resp === null || resp === void 0 ? void 0 : resp.data)) {
121
+ lhisp_logger_1.default.error({ message: "LhispOauthClient.getAccessToken", resp });
122
+ throw new Error("Resposta inválida ao obter token de acesso.");
123
+ }
120
124
  this.accessToken = this.buildAccessToken(resp.data);
121
125
  this.tokenCreatedAt = new Date().getTime();
122
126
  this.tokenExpiresIn = ((_a = this.accessToken) === null || _a === void 0 ? void 0 : _a.expires_in) || this.tokenCreatedAt + 60000;