mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-15 15:02:04 +00:00
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:
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();
|
||||
|
||||
Reference in new issue
Block a user