sn: 무한 루프 수정

This commit is contained in:
2026-04-17 11:45:16 +09:00
parent 24f377e048
commit c164b02081
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -1,10 +1,12 @@
import { NextRequest, NextResponse } from "next/server";
import { tokenManager } from "@/entities/auth/lib/token-manager";
export async function GET(request: NextRequest) {
const hostname = request.nextUrl.hostname;
const redirectUrl = process.env.NEXT_PUBLIC_CM_LOGIN_PAGE_URL || "https://portal.hasuon.or.kr";
if (hostname === "localhost" || hostname === "127.0.0.1" || hostname === "con.mind-one.co.kr") {
tokenManager.clearAuthToken();
return NextResponse.redirect(new URL("/", request.url)); // 로컬 및 개발 환경
} else {
return NextResponse.redirect(new URL(redirectUrl)); // 공단 환경
@@ -39,7 +39,7 @@ const AuthWrapper = ({ children }: { children: React.ReactNode }) => {
await authCheck();
} catch (error) {
console.error(error);
tokenManager.clearAuthToken();
setUserInfo(null);
if (isAtLoginRedirectUrl(LOGIN_PAGE_URL)) return;