Skip to content

Commit

Permalink
Merge pull request #133 from TripInfoWeb/dev_auth
Browse files Browse the repository at this point in the history
fix: build 에러 수정
  • Loading branch information
ssssksss authored Jul 25, 2024
2 parents 163264c + a650e28 commit 38c8b48
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/app/api/auth/user/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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();
}
}

0 comments on commit 38c8b48

Please sign in to comment.