Protected route issue : 'createRouteMatcher' NextJs
Unanswered
Pacific sand lance posted this in #help-forum
Pacific sand lanceOP
Hello
I can't figure ou what's the issue with my code, because, dashboard still accessible when unauthenticated
I can't figure ou what's the issue with my code, because, dashboard still accessible when unauthenticated
import { clerkMiddleware, createRouteMatcher} from '@clerk/nextjs/server'
const isProtectedRoute = createRouteMatcher(['/dashboard']);
export default clerkMiddleware(async(auth, req) => {
if (!isProtectedRoute(req)) await auth.protect()
});
Thank you for helping 🙂