copilot-api-plus 1.2.30 → 1.2.31

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/main.js CHANGED
@@ -1480,7 +1480,15 @@ accountRoutes.post("/auth/poll", async (c) => {
1480
1480
  consola.warn(`Device code poll: GitHub returned ${response.status}: ${errorText}`);
1481
1481
  return c.json({ status: "pending" });
1482
1482
  }
1483
- const json = await response.json();
1483
+ const rawText = await response.text();
1484
+ consola.debug(`Device code poll raw response: ${rawText}`);
1485
+ let json;
1486
+ try {
1487
+ json = JSON.parse(rawText);
1488
+ } catch {
1489
+ consola.warn(`Device code poll: GitHub returned non-JSON: ${rawText}`);
1490
+ return c.json({ status: "pending" });
1491
+ }
1484
1492
  if ("error" in json) switch (json.error) {
1485
1493
  case "authorization_pending": return c.json({ status: "pending" });
1486
1494
  case "slow_down": return c.json({