layero 0.1.0 → 0.1.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.
@@ -22,6 +22,7 @@ export async function loginCmd(opts) {
22
22
  const provider = opts.provider ?? "github";
23
23
  const desiredPort = opts.port ?? Number(process.env.LAYERO_LOGIN_PORT ?? 0);
24
24
  const tokenPromise = new Promise((resolve, reject) => {
25
+ let timeoutHandle;
25
26
  const server = http.createServer(async (req, res) => {
26
27
  const url = new URL(req.url ?? "/", "http://127.0.0.1");
27
28
  if (url.pathname !== "/callback") {
@@ -58,6 +59,8 @@ export async function loginCmd(opts) {
58
59
  "Access-Control-Allow-Origin": "*",
59
60
  })
60
61
  .end("ok — you can close this tab");
62
+ if (timeoutHandle)
63
+ clearTimeout(timeoutHandle);
61
64
  server.close();
62
65
  resolve(token);
63
66
  });
@@ -75,7 +78,7 @@ export async function loginCmd(opts) {
75
78
  // open failure is non-fatal — user can paste the URL manually.
76
79
  });
77
80
  });
78
- setTimeout(() => {
81
+ timeoutHandle = setTimeout(() => {
79
82
  server.close();
80
83
  reject(new Error(`login timed out after ${LOGIN_TIMEOUT_MS / 1000}s`));
81
84
  }, LOGIN_TIMEOUT_MS);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "layero",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Layero CLI — publish a local site with one command.",
5
5
  "license": "MIT",
6
6
  "type": "module",