@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.
- package/dist/index.js +6 -0
- 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",
|