diff --git a/apps/web/src/apis/Auth/postKakaoAuth.ts b/apps/web/src/apis/Auth/postKakaoAuth.ts index 7bb6a231..3ead72ae 100644 --- a/apps/web/src/apis/Auth/postKakaoAuth.ts +++ b/apps/web/src/apis/Auth/postKakaoAuth.ts @@ -22,7 +22,6 @@ const usePostKakaoAuth = () => { setAccessToken(data.accessToken); toast.success("로그인에 성공했습니다."); - setTimeout(() => { router.push("/"); }, 100); diff --git a/apps/web/src/middleware.ts b/apps/web/src/middleware.ts index 279d052a..f4294a86 100644 --- a/apps/web/src/middleware.ts +++ b/apps/web/src/middleware.ts @@ -2,7 +2,6 @@ import type { NextRequest } from "next/server"; import { NextResponse } from "next/server"; const loginNeedPages = ["/mentor", "/my", "/community"]; // 로그인 필요페이지 -const COMMUNITY_LOGIN_REASON = "community-members-only"; export function middleware(request: NextRequest) { const url = request.nextUrl.clone(); @@ -12,13 +11,6 @@ export function middleware(request: NextRequest) { // return NextResponse.next(); // } - // 서버 사이드 인증 체크가 활성화된 경우에만 미들웨어 적용 - // (RefreshToken은 항상 HTTP-only 쿠키로 관리됨) - const isServerSideAuthEnabled = process.env.NEXT_PUBLIC_COOKIE_LOGIN_ENABLED === "true"; - if (!isServerSideAuthEnabled) { - return NextResponse.next(); - } - // HTTP-only 쿠키의 refreshToken 확인 const refreshToken = request.cookies.get("refreshToken")?.value; @@ -28,13 +20,8 @@ export function middleware(request: NextRequest) { }); if (needLogin && !refreshToken) { - const isCommunityRoute = url.pathname === "/community" || url.pathname.startsWith("/community/"); url.pathname = "/login"; - if (isCommunityRoute) { - url.searchParams.set("reason", COMMUNITY_LOGIN_REASON); - } else { - url.searchParams.delete("reason"); - } + url.searchParams.delete("reason"); return NextResponse.redirect(url); }