-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmiddleware.ts
51 lines (49 loc) · 1.14 KB
/
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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import { authMiddleware } from "@clerk/nextjs";
export default authMiddleware({
apiRoutes: [
'/api/doubts',
'/api/doubts/create',
'/api/doubts/edit',
'/api/doubts/delete',
'/api/posts',
'/api/posts/create',
'/api/posts/edit',
'/api/posts/delete',
'/api/posts/like',
'/api/users/create',
'/api/users/edit',
'/api/users/delete',
'/api/users',
'/api/users/[id]',
'/api/users/[id]/follow',
'/api/users/[id]/unfollow'
],
publicRoutes: [
'/',
'/api/stripe',
'/api/webhook',
'/api/clerk-webhook',
"/api/webhooks(.*)",
'/undefined',
'/api/doubts',
'/api/doubts/create',
'/api/doubts/edit',
'/api/doubts/delete',
'/api/posts/create',
'/api/posts/like/:id',
'/api/users/create',
'/api/users/edit',
'/api/users/delete',
'/api/users',
'/api/users/[id]',
'/api/users/[id]/follow',
'/api/users/[id]/unfollow'
],
ignoredRoutes: ["/((?!api|trpc))(_next.*|.+\.[\w]+$)", "/undefined"]
});
export const config = {
matcher: [
"/((?!api|static|.*\\..*|_next).*)",
"/((?!.+\\.[\\w]+$|_next).*)", "/", "/(api|trpc)(.*)"
]
};