After abso login --server <url>, whoami and doctor still looked at https://api.abso.dev outside a folder, so they said you weren't signed in, and doctor checked the wrong server. Both now take --server, then ABSO_SERVER, then the folder's server, then the server this box signed in to with abso login, then https://api.abso.dev. A box signed in to more than one server is asked to say which with --server, as join does. Help text says so. Test in client/test/doctor.test.ts.
- MCP
- show on this site's /mcp
- CLI
- abso show 84 --json
- JSON
- /christopher/abso-core/versions/84?format=json
whoami and doctor pick the server as join does
of shared·speed··Not checked
Version 83 · Files at version 84
3 files, 55 lines added, 7 removed.
--- a/client/src/doctor.ts
+++ b/client/src/doctor.ts
@@ -3,9 +3,12 @@
33// when one fails. Neither prints a credential. plainError words the commonest failures the same way.
44
6−import { type Answer, type BoxRecord, boxGet, boxText, originOf, readBox } from "./box.ts";
7+import { type Answer, type BoxRecord, boxGet, boxText, originOf, readBox, signedInServers } from "./box.ts";
912
1013/** The lowest Node major each kind of copy runs on: the npm package is built for 20, a checkout runs its .ts as is. */
@@ -39,6 +42,28 @@
4144
46+ * The server whoami and doctor look at, in the order join picks one: --server, then ABSO_SERVER, then this
47+ * folder's server, then the one this box signed in to with abso login, then https://api.abso.dev. A box signed
63+ throw new UsageError(`this box is signed in to ${signedIn.join(" and ")}: say which with --server <url>`);
66+
4368
--- a/client/src/main.ts
+++ b/client/src/main.ts
@@ -39,7 +39,7 @@
42−import { doctor, doctorText, plainError, realProbe, whoami } from "./doctor.ts";
@@ -208,9 +208,9 @@
211− "Who and where you're signed in: this box's sign-in, as the server sees it (so a revoked one shows), its projects, roles and expiry, and this folder's project, agent and kind of key. Never a credential.",
211+ "Who and where you're signed in: this box's sign-in, as the server sees it (so a revoked one shows), its projects, roles and expiry, and this folder's project, agent and kind of key. Never a credential. The server is --server, else ABSO_SERVER, else this folder's, else the one this box signed in to with abso login, else https://api.abso.dev.",
213− const out = await whoami(boxServer(args, env), env.cwd, env.env, realProbe());
213+ const out = await whoami(checkServer(str(args, "server"), env.cwd, env.env), env.cwd, env.env, realProbe());
@@ -218,9 +218,9 @@
221− "Checks what commands need, one line each: Node's version, that the server answers, this box's sign-in (present, unexpired, accepted), and this folder's key against its project. A failed check says what to do next, and the exit is 1. Never prints a credential.",
221+ "Checks what commands need, one line each: Node's version, that the server answers, this box's sign-in (present, unexpired, accepted), and this folder's key against its project. A failed check says what to do next, and the exit is 1. Never prints a credential. It picks the server as whoami does.",
223− const checks = await doctor(boxServer(args, env), env.cwd, env.env, realProbe());
223+ const checks = await doctor(checkServer(str(args, "server"), env.cwd, env.env), env.cwd, env.env, realProbe());
225225 return { text: doctorText(checks), json: { checks }, ...(failed ? { exit: EXIT.error } : {}) };
--- a/client/test/doctor.test.ts
+++ b/client/test/doctor.test.ts
@@ -8,7 +8,7 @@
11−import { doctor, doctorText, nodeNeeded, type Probe, plainError, whoami } from "../src/doctor.ts";
11+import { checkServer, doctor, doctorText, nodeNeeded, type Probe, plainError, whoami } from "../src/doctor.ts";
1212
@@ -227,3 +227,26 @@
230+
231+test("whoami and doctor pick the server as join does: --server, ABSO_SERVER, the folder's, the box's sign-in, then abso.dev", () => {
239+ assert.equal(checkServer(undefined, outside, { ABSO_SERVER: "http://env.example" }, home, NOW), "http://env.example");
241+ checkServer("http://flag.example", folder(), { ABSO_SERVER: "http://env.example" }, home, NOW),