fix(frontend): satisfy Clerk auth() types in middleware

Avoid calling protect() on a Promise by awaiting auth() first.
This commit is contained in:
Arjun (OpenClaw)
2026-02-07 19:36:52 +00:00
parent 260e0815a8
commit 9184ebed25

View File

@@ -14,7 +14,8 @@ const isPublicRoute = createRouteMatcher(["/sign-in(.*)"]);
export default isClerkEnabled()
? clerkMiddleware(async (auth, req) => {
if (isPublicRoute(req)) return NextResponse.next();
await auth().protect();
const session = await auth();
session.protect();
return NextResponse.next();
})
: () => NextResponse.next();