fix(frontend): await auth().protect in middleware

Clerk middleware auth() is async in current types; await protect() to satisfy TS and avoid runtime issues.
This commit is contained in:
Arjun (OpenClaw)
2026-02-07 19:34:11 +00:00
parent 05a83b765b
commit 260e0815a8

View File

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