diff --git a/src/main/java/com/back/global/security/oauth/OAuth2LoginSuccessHandler.java b/src/main/java/com/back/global/security/oauth/OAuth2LoginSuccessHandler.java index e19adfbe..7c0ba157 100644 --- a/src/main/java/com/back/global/security/oauth/OAuth2LoginSuccessHandler.java +++ b/src/main/java/com/back/global/security/oauth/OAuth2LoginSuccessHandler.java @@ -18,6 +18,7 @@ import org.springframework.security.core.Authentication; import org.springframework.security.web.authentication.AuthenticationSuccessHandler; import org.springframework.stereotype.Component; +import org.springframework.web.util.UriComponentsBuilder; import java.io.IOException; import java.time.LocalDateTime; @@ -71,21 +72,8 @@ public void onAuthenticationSuccess(HttpServletRequest request, true ); - // 응답 데이터 구성 - LoginResponse loginResponse = new LoginResponse( - accessToken, - UserResponse.from(user) - ); - - RsData rsData = RsData.success( - "소셜 로그인에 성공했습니다.", - loginResponse - ); - - // JSON 직렬화 후 응답 - response.setStatus(HttpServletResponse.SC_OK); - response.setContentType("application/json;charset=UTF-8"); - objectMapper.writeValue(response.getWriter(), rsData); + // 프론트엔드 리다이렉트 + response.sendRedirect("http://localhost:3000/login/oauth2"); } catch (CustomException e) { handleException(response, e); } catch (Exception e) {