From 601fc201f067998b44a1b110d7accd20c3998fba Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 9 Feb 2026 23:22:37 +0000 Subject: [PATCH] Cover runtime auth token trimming semantics Co-authored-by: Theo Browne --- apps/t3/src/runtimeApiServer.test.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/apps/t3/src/runtimeApiServer.test.ts b/apps/t3/src/runtimeApiServer.test.ts index 80a3a20206..ffd3c8d2a4 100644 --- a/apps/t3/src/runtimeApiServer.test.ts +++ b/apps/t3/src/runtimeApiServer.test.ts @@ -137,6 +137,23 @@ describe("runtimeApiServer", () => { client.socket.close(); }); + it("trims configured auth token before validating connections", async () => { + const server = await startRuntimeApiServer({ + port: 0, + launchCwd: process.cwd(), + authToken: " secret-token ", + }); + servers.push(server); + + const wsUrl = new URL(server.wsUrl); + expect(wsUrl.searchParams.get("token")).toBe("secret-token"); + + const client = await connectClient(server.wsUrl); + const hello = await client.nextMessage(); + expect(hello.type).toBe("hello"); + client.socket.close(); + }); + it("responds to todos.list over websocket RPC", async () => { const server = await startRuntimeApiServer({ port: 0,