@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.
- package/dist/http-client.js +20 -15
- package/package.json +1 -1
package/dist/http-client.js
CHANGED
|
@@ -120,21 +120,26 @@ export class HttpClient {
|
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
export async function updateAuthorization(refreshToken) {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
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
|
}
|