Spaces:
Sleeping
Sleeping
FauziIsyrinApridal
commited on
Commit
·
0517d51
1
Parent(s):
43be92e
revisi 9
Browse files- middleware.ts +7 -1
middleware.ts
CHANGED
@@ -8,7 +8,13 @@ export async function middleware(request: NextRequest) {
|
|
8 |
|
9 |
const { pathname } = request.nextUrl;
|
10 |
// Allow public auth pages without role gate
|
11 |
-
const publicPaths = [
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
const isPublic = publicPaths.some((p) => pathname.startsWith(p));
|
13 |
if (isPublic) return response;
|
14 |
|
|
|
8 |
|
9 |
const { pathname } = request.nextUrl;
|
10 |
// Allow public auth pages without role gate
|
11 |
+
const publicPaths = [
|
12 |
+
"/login",
|
13 |
+
"/forgot-password",
|
14 |
+
"/reset-password",
|
15 |
+
// Public API endpoint for cron to trigger scraping (secured by CRON_SECRET in route)
|
16 |
+
"/api/cron-scraping",
|
17 |
+
];
|
18 |
const isPublic = publicPaths.some((p) => pathname.startsWith(p));
|
19 |
if (isPublic) return response;
|
20 |
|