mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
Refactor asset handling and authentication logic (for node)
Updated asset path configuration and server-side logic to standardize asset serving. Introduced `shouldSkipAuth` to bypass authentication for asset requests. Added test coverage for the new asset path handling logic.
This commit is contained in:
9
app/__test__/auth/middleware.spec.ts
Normal file
9
app/__test__/auth/middleware.spec.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { describe, expect, it } from "bun:test";
|
||||
import { shouldSkipAuth } from "../../src/auth/middlewares";
|
||||
|
||||
describe("auth middleware", () => {
|
||||
it("should skip auth on asset paths", () => {
|
||||
expect(shouldSkipAuth({ req: new Request("http://localhost/assets/test.js") })).toBe(true);
|
||||
expect(shouldSkipAuth({ req: new Request("http://localhost/") })).toBe(false);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user