Skip to content

Commit

Permalink
fix. redirect URI 경로 재수정
Browse files Browse the repository at this point in the history
  • Loading branch information
soyesenna committed Jun 5, 2024
1 parent 8dfcf83 commit 955ca02
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
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;

import java.io.IOException;

@Component
@Slf4j
public class CustomAuthenticationSuccessHandler extends SimpleUrlAuthenticationSuccessHandler {

@Override
Expand All @@ -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);
Expand Down

0 comments on commit 955ca02

Please sign in to comment.