Skip to content
Source
Sign inSign up
pingdotgg/t3code

Let clients without a managed backend manage pairing #4496

Closedcolonelpanic8(GitHub profile, opens in a new tab)wants to merge 7 commits intomain fromrefs/pull/4496/headopened View on GitHub

Showing 12 changed files with 43 additions and 0 deletions (loading 10).

x
0 of 12 viewed, 12 left
38 additions and 0 deletionsapps/server/src/cliAuthFormat.test.tsModified
View file
@@ -23,6 +23,44 @@
​
expect(output).toContain("secret-pairing-token");
expect(output).toContain("https://example.com/pair#token=secret-pairing-token");
+ // Scannable from another device, matching `t3 serve`'s startup output.
+ expect(output).toContain("█");
+});
+​
+it("omits the QR code when there is no pair URL worth scanning", () => {
+ const output = formatIssuedPairingCredential(
+ {
+ id: "pairing-1",
+ credential: "secret-pairing-token",
+ scopes: ["orchestration:read"],
+ subject: "one-time-token",
+ createdAt: DateTime.makeUnsafe("2026-04-08T09:00:00.000Z"),
+ expiresAt: DateTime.makeUnsafe("2026-04-08T10:00:00.000Z"),
+ },
+ { json: false },
+ );
+​
+ expect(output).toContain("secret-pairing-token");
+ expect(output).not.toContain("█");
+});
+​
+it("keeps JSON output machine-readable rather than embedding a QR code", () => {
+ const output = formatIssuedPairingCredential(
+ {
+ id: "pairing-1",
+ credential: "secret-pairing-token",