Theo's Typesafe CultTTC
Theo's Typesafe Cult3y ago
5 replies
Kenzo

Theo T3 Stack Tutorial - withClerkMiddleware soon deprecated

Hi, The tutorial uses withClerkMiddleware for the middleware.ts

The old one had public routes unless specified =>
export default withClerkMiddleware((req: NextRequest) => {
  return NextResponse.next();
});

but the new one are all private unless you specify the public routes right? or am I being confused?
export default authMiddleware({
  // "/" will be accessible to all users
  publicRoutes: ["/"]
});

using this, / is public, but when doing trpc calls like the post.getAll() it returns Unauthorized, how do I fix this?
thanks 🙂
image.png
Was this page helpful?