diff --git a/BE/src/main/java/team07/airbnb/config/security/CustomAuthenticationSuccessHandler.java b/BE/src/main/java/team07/airbnb/config/security/CustomAuthenticationSuccessHandler.java index 4ec2f381..75ce0dba 100644 --- a/BE/src/main/java/team07/airbnb/config/security/CustomAuthenticationSuccessHandler.java +++ b/BE/src/main/java/team07/airbnb/config/security/CustomAuthenticationSuccessHandler.java @@ -3,6 +3,7 @@ import jakarta.servlet.ServletException; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; +import lombok.extern.slf4j.Slf4j; import org.springframework.security.core.Authentication; import org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler; import org.springframework.stereotype.Component; @@ -10,6 +11,7 @@ import java.io.IOException; @Component +@Slf4j public class CustomAuthenticationSuccessHandler extends SimpleUrlAuthenticationSuccessHandler { @Override @@ -18,6 +20,8 @@ public void onAuthenticationSuccess(HttpServletRequest request, Authentication authentication) throws IOException, ServletException { // 로그인 성공 시 리다이렉트할 URL 설정 String requestURI = request.getRequestURI(); + log.warn("requestURI : " + requestURI); + setDefaultTargetUrl("/api/" + requestURI); super.onAuthenticationSuccess(request, response, authentication);