From aca4967517ff91fef2a5dd89c20b99d8a72b02e6 Mon Sep 17 00:00:00 2001 From: wobsoriano Date: Tue, 23 Jul 2024 15:20:16 -0700 Subject: [PATCH 1/3] fix(astro): Middleware return type --- packages/astro/src/server/clerk-middleware.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/astro/src/server/clerk-middleware.ts b/packages/astro/src/server/clerk-middleware.ts index a1e4f90825e..d15c6d1b122 100644 --- a/packages/astro/src/server/clerk-middleware.ts +++ b/packages/astro/src/server/clerk-middleware.ts @@ -40,7 +40,7 @@ type ClerkAstroMiddlewareHandler = ( auth: () => ClerkMiddlewareAuthObject, context: AstroMiddlewareContextParam, next: AstroMiddlewareNextParam, -) => AstroMiddlewareReturn; +) => AstroMiddlewareReturn | undefined; type ClerkAstroMiddlewareOptions = AuthenticateRequestOptions; From 6fe24c3659ac9c64d604d01c30727eefc1de0a75 Mon Sep 17 00:00:00 2001 From: Robert Soriano Date: Tue, 23 Jul 2024 15:36:37 -0700 Subject: [PATCH 2/3] chore: add changeset --- .changeset/ninety-squids-appear.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/ninety-squids-appear.md diff --git a/.changeset/ninety-squids-appear.md b/.changeset/ninety-squids-appear.md new file mode 100644 index 00000000000..30e1fa57ca6 --- /dev/null +++ b/.changeset/ninety-squids-appear.md @@ -0,0 +1,5 @@ +--- +"@clerk/astro": patch +--- + +Fix middleware return type. From 6c4c96d7c0cfd7c1338dc9ddc8fdba9269395056 Mon Sep 17 00:00:00 2001 From: Robert Soriano Date: Wed, 24 Jul 2024 07:05:12 -0700 Subject: [PATCH 3/3] chore(astro): Update changeset text --- .changeset/ninety-squids-appear.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/ninety-squids-appear.md b/.changeset/ninety-squids-appear.md index 30e1fa57ca6..7a8e0b4e07d 100644 --- a/.changeset/ninety-squids-appear.md +++ b/.changeset/ninety-squids-appear.md @@ -2,4 +2,4 @@ "@clerk/astro": patch --- -Fix middleware return type. +Allow the handler of `clerkMiddleware` to return undefined. When undefined is returned, `clerkMiddleware` implicitly calls `await next()`.