@stage-labs/metro 0.1.0-beta.26 → 0.1.0-beta.27

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/prompt.js CHANGED
@@ -35,7 +35,7 @@ export function askSecret(question) {
35
35
  stdin.resume();
36
36
  stdin.setEncoding('utf8');
37
37
  return new Promise((resolve, reject) => {
38
- let value = '\u0003';
38
+ let value = '';
39
39
  const finish = () => {
40
40
  stdin.setRawMode(false);
41
41
  stdin.pause();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stage-labs/metro",
3
- "version": "0.1.0-beta.26",
3
+ "version": "0.1.0-beta.27",
4
4
  "description": "The metro command line. Sign in once per machine, then hand your MCP connector list to Claude Code without the credentials touching disk, argv or shell history.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -40,11 +40,16 @@ async function handleClaim(
40
40
  sendJson(req, res, 503, { error: 'sign-in is not configured' });
41
41
  return;
42
42
  }
43
- const code = bodyField(await readJsonBody(req), 'code');
44
- const taken =
45
- typeof code === 'string' && CLI_CODE_RE.test(code)
46
- ? takeCliCode(code)
47
- : undefined;
43
+ const raw = bodyField(await readJsonBody(req), 'code');
44
+ const code = typeof raw === 'string' ? raw.trim() : '';
45
+ if (!CLI_CODE_RE.test(code)) {
46
+ sendJson(req, res, 400, {
47
+ error:
48
+ 'that does not look like a collection code — metro login wants the mc_… code from metro.box/#/authorize',
49
+ });
50
+ return;
51
+ }
52
+ const taken = takeCliCode(code);
48
53
  if (taken === undefined) {
49
54
  sendJson(req, res, 400, {
50
55
  error: 'that code has expired or was already used',
@@ -51,11 +51,16 @@ async function handleClaim(
51
51
  return;
52
52
  }
53
53
  const body = await readJsonBody(req);
54
- const code = bodyField(body, 'code');
55
- const taken =
56
- typeof code === 'string' && RUN_CODE_RE.test(code)
57
- ? takeRunCode(code)
58
- : undefined;
54
+ const raw = bodyField(body, 'code');
55
+ const code = typeof raw === 'string' ? raw.trim() : '';
56
+ if (!RUN_CODE_RE.test(code)) {
57
+ sendJson(req, res, 400, {
58
+ error:
59
+ 'that does not look like a runtime code — metro start wants the mr_… code from the agent page',
60
+ });
61
+ return;
62
+ }
63
+ const taken = takeRunCode(code);
59
64
  if (taken === undefined) {
60
65
  sendJson(req, res, 400, {
61
66
  error: 'that code has expired or was already used',
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "0.1.0-beta.26"
2
+ "version": "0.1.0-beta.27"
3
3
  }