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();
});
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: ["/"]
});
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 🙂
No description
1 Reply
Kenzo
KenzoOP•16mo ago
publicRoutes: ["/", "/api(.*)"],
publicRoutes: ["/", "/api(.*)"],
this fixed the issue for the api issues -- but its dumb it doesnt matter if you have publicProcedure in TRPC or not, since you will have to also add that in Clerk, right? -- Ah, people already said that https://discord.com/channels/966627436387266600/1150832384707678288/1150868870312239205
Want results from more Discord servers?
Add your server