;
}
diff --git a/apps/web/src/features/first-run/auth.test.ts b/apps/web/src/features/first-run/auth.test.ts
index 69f905e8e..74604e876 100644
--- a/apps/web/src/features/first-run/auth.test.ts
+++ b/apps/web/src/features/first-run/auth.test.ts
@@ -1,27 +1,29 @@
import { afterEach, describe, expect, it, vi } from "vitest";
-import { changeConsoleAuth, parseConsoleAuth, readConsoleAuth } from "./auth";
+import { changeConsoleAuth, ConsoleAuthError, parseConsoleAuth, readConsoleAuth } from "./auth";
afterEach(() => vi.unstubAllGlobals());
describe("console authentication boundary", () => {
- it("accepts only finite modes and returns no additional server fields", () => {
- expect(parseConsoleAuth({ mode: "authenticated", username: "admin", token: "secret" })).toEqual({ mode: "authenticated", username: "admin" });
- for (const value of [null, {}, { mode: "admin" }, { mode: "authenticated" }, { mode: "authenticated", username: "" }]) expect(() => parseConsoleAuth(value)).toThrow();
+ it("accepts only the login and authenticated modes and keeps no other server field", () => {
+ expect(parseConsoleAuth({ mode: "authenticated", username: "admin", token: "secret" })).toEqual({ mode: "authenticated" });
+ expect(parseConsoleAuth({ mode: "login" })).toEqual({ mode: "login" });
+ for (const value of [null, {}, { mode: "admin" }, { mode: "setup" }, { mode: "legacy" }]) expect(() => parseConsoleAuth(value)).toThrow();
});
- it("allows the legacy static response only before account mode is established", async () => {
- vi.stubGlobal("fetch", vi.fn(async () => new Response("