@brokerize/client 1.3.2 → 1.3.3

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.
Files changed (2) hide show
  1. package/dist/index.js +6 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -47,6 +47,12 @@ export class Brokerize {
47
47
  // XXX some runtimes do not have URLSearchParams, so just produce the body in the old-fashioned way
48
48
  body: `grant_type=refresh_token&refresh_token=${encodeURIComponent(refreshToken)}`,
49
49
  });
50
+ if (!response.ok) {
51
+ throw new BrokerizeError(401, {
52
+ msg: "The token could not be refreshed. Please log in again.",
53
+ code: "AUTH",
54
+ });
55
+ }
50
56
  const responseJson = (await response.json());
51
57
  return {
52
58
  type: "guest",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brokerize/client",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "Client for the brokerize.com API",
5
5
  "keywords": [],
6
6
  "homepage": "https://github.com/brokerize/client-js#readme",