pi-meta-oauth 0.6.0 → 0.6.1
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/extensions/meta.ts +7 -1
- package/package.json +1 -1
package/extensions/meta.ts
CHANGED
|
@@ -249,8 +249,14 @@ export async function mintMetaApiKey(
|
|
|
249
249
|
const body = (await responseBody(response)) as MintResponse &
|
|
250
250
|
Record<string, unknown>;
|
|
251
251
|
if (!response.ok) {
|
|
252
|
+
const detail = errorDetail(body);
|
|
253
|
+
if (response.status === 401 || response.status === 403) {
|
|
254
|
+
throw new Error(
|
|
255
|
+
`Meta session expired (HTTP ${response.status}); run /login meta again${detail ? `: ${detail}` : ""}`,
|
|
256
|
+
);
|
|
257
|
+
}
|
|
252
258
|
throw new Error(
|
|
253
|
-
`Meta API-key mint failed (HTTP ${response.status})${
|
|
259
|
+
`Meta API-key mint failed (HTTP ${response.status})${detail ? `: ${detail}` : ""}`,
|
|
254
260
|
);
|
|
255
261
|
}
|
|
256
262
|
if (typeof body.api_key !== "string" || !body.api_key) {
|