test(auth): assert the cookie path returns the derived authMethod

The cookie arm of requireAuth now carries authMethod: "cookie" alongside the
session payload, so the exact-shape assertion expects it.
This commit is contained in:
Marc-André Bombeck committed 2026-07-23 21:36:01 +02:00
1 parent 6e46afc1fc
commit c1bb997de7
2 files changed
+10 -11

No files matched your search

@@ -390,7 +390,8 @@ describe("requireAuth — cookie path remains intact", () => {
const ctx = await requireAuth("medication:ingest");
expect(ctx).toEqual(cookieSession);
// The cookie path carries the session payload plus the derived transport.
expect(ctx).toEqual({ ...cookieSession, authMethod: "cookie" });
// Cookie short-circuits before any token logic runs.
expect(prisma.apiToken.findUnique).not.toHaveBeenCalled();
expect(hashToken).not.toHaveBeenCalled();