diff --git a/apps/client/middleware.ts b/apps/client/middleware.ts index ef508930..d0f189d2 100644 --- a/apps/client/middleware.ts +++ b/apps/client/middleware.ts @@ -19,26 +19,20 @@ const middleware = async (req: NextRequest) => { } if (!cacheCookie) { - try { - const { memberRole } = await dashboardApi.getDashboardInfo(); + const { memberRole } = await dashboardApi.getDashboardInfo(); - if (memberRole !== "REGULAR") { - return NextResponse.redirect(new URL(routePath.auth, req.url)); - } - - const response = NextResponse.next(); - response.cookies.set(cookieKey["middleware-executed"], "true", { - httpOnly: true, - secure: true, - sameSite: "lax", - }); + if (memberRole !== "REGULAR") { + return NextResponse.redirect(new URL(routePath.auth, req.url)); + } - return response; - } catch (error) { - console.error("API 호출 오류:", error); + const response = NextResponse.next(); + response.cookies.set(cookieKey["middleware-executed"], "true", { + httpOnly: true, + secure: true, + sameSite: "lax", + }); - return NextResponse.next(); - } + return response; } return NextResponse.next();