Skip to content

Commit

Permalink
🐛 uri 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
yerimm99 committed Feb 18, 2024
1 parent b61780c commit 6432dc6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class MyAuthenticationFailureHandler implements AuthenticationFailureHand
public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response,
AuthenticationException exception) throws IOException, ServletException {
// 인증 실패시 메인 페이지로 이동
response.sendRedirect("http://localhost:8080/");
response.sendRedirect("https://dev.nangmancat.shop/");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

import aromanticcat.umcproject.security.jwt.GeneratedToken;
import aromanticcat.umcproject.security.jwt.JwtUtil;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.core.Authentication;
import org.springframework.security.oauth2.core.user.OAuth2User;
import org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler;
import org.springframework.stereotype.Component;
import org.springframework.web.util.UriComponentsBuilder;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

@Slf4j
@Component
Expand Down Expand Up @@ -48,7 +48,7 @@ public void onAuthenticationSuccess(HttpServletRequest request, HttpServletRespo
log.info("jwtToken = {}", token.getAccessToken());

// accessToken을 쿼리스트링에 담는 url을 만들어준다.
String targetUrl = UriComponentsBuilder.fromUriString("http://localhost:8080/")
String targetUrl = UriComponentsBuilder.fromUriString("https://dev.nangmancat.shop/")
//.queryParam("accessToken", token.getAccessToken())
.build()
.encode(StandardCharsets.UTF_8)
Expand All @@ -72,7 +72,7 @@ public void onAuthenticationSuccess(HttpServletRequest request, HttpServletRespo
} else {

// 회원이 존재하지 않을경우, 서비스 제공자와 email을 쿼리스트링으로 전달하는 url을 만들어준다.
String targetUrl = UriComponentsBuilder.fromUriString("http://localhost:8080/")
String targetUrl = UriComponentsBuilder.fromUriString("https://dev.nangmancat.shop/signUp")
.queryParam("email", (String) oAuth2User.getAttribute("email"))
.queryParam("provider", provider)
.build()
Expand Down

0 comments on commit 6432dc6

Please sign in to comment.