kubetail-org / edge-csrf

CSRF protection library for JavaScript that runs on the edge runtime (with Next.js, SvelteKit, Express, Node-HTTP integrations)
MIT License
140 stars 7 forks source link

excludePathPrefixes config option is missing in dist folder #10

Closed flohil closed 1 year ago

flohil commented 1 year ago

Hi!

I just installed version 1.0.3 of edge-csrf and it seems the excludePathPrefixes config option is missing in the packaged dist folder.

image

As a workaround, one can manually skip the invocation of csrfProtect in middleware.ts:

export async function middleware(req: NextRequest) {
  const res = NextResponse.next();

  if (!req.nextUrl.pathname.startsWith('/_next/')) {
    csrfProtect(req, res);
  }
amorey commented 1 year ago

Thanks for the heads up! Try v1.0.4: https://www.npmjs.com/package/edge-csrf/v/1.0.4

amorey commented 1 year ago

@flohil Did v1.0.4 fix the issue?

flohil commented 1 year ago

Hey @amorey! Version 1.0.4 now includes the excludePathPrefixes config option in the dist folder. Thank you for the fast fix!