From 77f3edc7ab4e4123e2dd381dd44a5e7fdf75e965 Mon Sep 17 00:00:00 2001 From: Anand Suthar Date: Fri, 20 Sep 2024 18:20:07 +0530 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20chore:=20add=20skip=20path=20check?= =?UTF-8?q?=20for=20routes=20starting=20with=20/api/auth?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- middlewares/handleApiRoute.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/middlewares/handleApiRoute.ts b/middlewares/handleApiRoute.ts index 83b4b93..2ba5d55 100644 --- a/middlewares/handleApiRoute.ts +++ b/middlewares/handleApiRoute.ts @@ -8,7 +8,7 @@ export default async function handleApiRoute(request: NextRequest) { const path = request.nextUrl.pathname; // skipping middleware - if (SKIP_PATHS.includes(path)) { + if (SKIP_PATHS.some((skipPath) => path.startsWith(skipPath))) { return NextResponse.next(); }