-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmiddleware.ts
23 lines (17 loc) · 877 Bytes
/
middleware.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Without a defined matcher, this one line applies next-auth
// to the entire project
// export { default } from "next-auth/middleware"
// Applies next-auth only to matching routes - can be regex
// Ref: https://nextjs.org/docs/app/building-your-application/routing/middleware#matcher
// export const config = { matcher: ["/extra", "/dashboard"] }
import { authMiddleware } from "@clerk/nextjs";
// This example protects all routes including api/trpc routes
// Please edit this to allow other routes to be public as needed.
// See https://clerk.com/docs/references/nextjs/auth-middleware for more information about configuring your Middleware
//avoid potential errors, avoid getting blocked by clerk
export default authMiddleware({
publicRoutes: ["/api/uploadthing"]
});
export const config = {
matcher: ["/((?!.+\\.[\\w]+$|_next).*)", "/", "/(api|trpc)(.*)"],
};