diff --git a/src/app/api/auth/user/route.ts b/src/app/api/auth/user/route.ts index 95edba0e..aff4c0b4 100644 --- a/src/app/api/auth/user/route.ts +++ b/src/app/api/auth/user/route.ts @@ -12,6 +12,7 @@ export async function GET(request: NextRequest) { // 리프레시 토큰으로 재발급 받아 재요청 보내기 위한 응답 return new NextResponse("Refresh token not found", { status: 401 }); } + // 사용자 정보 조회 API const response = await fetch(`${process.env.BACKEND_URL}/api/users/info`, { method: "GET", @@ -22,16 +23,17 @@ export async function GET(request: NextRequest) { }, cache: "no-store", }); - if (response.status == 200) { + + if (response.status === 200) { const data = await response.json(); return new NextResponse(JSON.stringify(data), { status: 200, headers: { "Content-Type": "application/json" }, }); } else { - return new Error("Internal Server Error"); + return NextResponse.error(); } } catch (error) { - return new Error("Internal Server Error"); + return NextResponse.error(); } }