perf(html): replace proxyAuth with getToken to remove set-cookie; add Cache-Control per auth state
This commit is contained in:
1 parent
2799b63943
commit
7c1f8d709e
3 files changed
+28
-12
No files matched your search
@@ -1,4 +1,5 @@
|
||||
export interface ProxyToken {
|
||||
sub?: string;
|
||||
rank?: unknown;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,14 +2,12 @@ import { readFileSync } from "node:fs";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
describe("proxy authentication boundary", () => {
|
||||
it("uses a database-free Auth.js decoder", () => {
|
||||
it("uses getToken directly without database-dependent Auth.js config", () => {
|
||||
const proxy = readFileSync("src/proxy.ts", "utf8");
|
||||
const proxyAuth = readFileSync("src/lib/proxy-auth.ts", "utf8");
|
||||
|
||||
expect(proxy).toContain('from "@/lib/proxy-auth"');
|
||||
expect(proxy).not.toContain('from "@/lib/proxy-auth"');
|
||||
expect(proxy).not.toContain('from "@/lib/auth"');
|
||||
expect(proxyAuth).not.toMatch(
|
||||
/from\s+["'][^"']*(db|site-settings|credentials|prisma)[^"']*["']/i,
|
||||
);
|
||||
expect(proxy).toContain("getToken");
|
||||
expect(proxy).toContain("next-auth/jwt");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user