diff --git a/src/main/kotlin/com/example/toyTeam6Airbnb/config/CustomAuthenticationSuccessHandler.kt b/src/main/kotlin/com/example/toyTeam6Airbnb/config/CustomAuthenticationSuccessHandler.kt index 3e07562..8d52d0f 100644 --- a/src/main/kotlin/com/example/toyTeam6Airbnb/config/CustomAuthenticationSuccessHandler.kt +++ b/src/main/kotlin/com/example/toyTeam6Airbnb/config/CustomAuthenticationSuccessHandler.kt @@ -22,15 +22,6 @@ class CustomAuthenticationSuccessHandler( ) { val token = jwtTokenProvider.generateToken(authentication.name) - if (profile == "prod") { - // 배포 환경에서는 기존 리다이렉트 동작 유지 - response.sendRedirect("/redirect?token=$token") - } else { - // 로컬 환경에서는 JSON 응답 반환 - response.contentType = "application/json" - response.characterEncoding = "UTF-8" - response.writer.write("{\"success\": true, \"token\": \"$token\"}") - response.writer.flush() - } + response.sendRedirect("/redirect?token=$token") } } diff --git a/src/test/kotlin/com/example/toyTeam6Airbnb/UserControllerTest.kt b/src/test/kotlin/com/example/toyTeam6Airbnb/UserControllerTest.kt index c43151f..3b1db82 100644 --- a/src/test/kotlin/com/example/toyTeam6Airbnb/UserControllerTest.kt +++ b/src/test/kotlin/com/example/toyTeam6Airbnb/UserControllerTest.kt @@ -70,7 +70,7 @@ constructor( .content(requestBody) .accept(MediaType.ALL) ) - .andExpect(status().isOk) // expect 200 status + .andExpect(status().isFound) // expect 200 status .andReturn() val response = result.response