@meowinc/meow-sdk 0.13.1 → 0.13.2

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/http-client.js +20 -15
  2. package/package.json +1 -1
@@ -120,21 +120,26 @@ export class HttpClient {
120
120
  }
121
121
  }
122
122
  export async function updateAuthorization(refreshToken) {
123
- const updateAuth = await fetch(`${ACCOUNT_API}/v1/sessions/update-session`, {
124
- method: "POST",
125
- headers: {
126
- "Content-Type": "application/json",
127
- },
128
- body: JSON.stringify({
129
- refreshToken,
130
- }),
131
- });
132
- if (!updateAuth.ok) {
133
- return Result.withError({
134
- type: "authorization",
135
- message: "Update authorization error. Please login first",
123
+ try {
124
+ const updateAuth = await fetch(`${ACCOUNT_API}/v1/sessions/update-session`, {
125
+ method: "POST",
126
+ headers: {
127
+ "Content-Type": "application/json",
128
+ },
129
+ body: JSON.stringify({
130
+ refreshToken,
131
+ }),
136
132
  });
133
+ if (!updateAuth.ok) {
134
+ return Result.withError({
135
+ type: "authorization",
136
+ message: "Update authorization error. Please login first",
137
+ });
138
+ }
139
+ const tokens = (await updateAuth.json());
140
+ return Result.withOk(tokens);
141
+ }
142
+ catch (err) {
143
+ return Result.withError(err);
137
144
  }
138
- const tokens = (await updateAuth.json());
139
- return Result.withOk(tokens);
140
145
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meowinc/meow-sdk",
3
- "version": "0.13.1",
3
+ "version": "0.13.2",
4
4
  "description": "Meow SDK",
5
5
  "keywords": [
6
6
  "sdk"