sdyl405w4: Remove the sign-out feature and the Minnect revoke call

This commit is contained in:
2026-10-19 17:03:29 -06:00
parent 5c53bd9afb
commit ab78a61851
7 changed files with 9 additions and 191 deletions
-25
View File
@@ -1,6 +1,5 @@
import { describe, expect, it, vi } from "vitest";
import {
endSession,
ensureFreshSession,
refreshSession,
} from "@/lib/session-refresh";
@@ -113,27 +112,3 @@ describe("refreshSession failure", () => {
expect(getSession(id)).toBeNull();
});
});
describe("endSession", () => {
it("revokes the refresh token and deletes the session", async () => {
const id = seedSession(Date.now() + 60 * 60_000);
const fetchImpl = vi.fn(async (_input: RequestInfo | URL) => json({ data: { success: true } }));
await endSession(id, { fetchImpl: fetchImpl as unknown as typeof fetch });
expect(fetchImpl.mock.calls.some(([u]) => String(u).endsWith("/api/v4/auth/revoke-token"))).toBe(true);
expect(getSession(id)).toBeNull();
});
it("still deletes the session when revoke throws", async () => {
const id = seedSession(Date.now() + 60 * 60_000);
const fetchImpl = vi.fn(async (_input: RequestInfo | URL): Promise<Response> => {
throw new Error("revoke down");
});
await expect(
endSession(id, { fetchImpl: fetchImpl as unknown as typeof fetch }),
).resolves.toBeUndefined();
expect(getSession(id)).toBeNull();
});
});