Skip to content

Commit

Permalink
카카오 로그인 요청 헤더 추출 로직에서 NULL 예외처리 구현 (#122)
Browse files Browse the repository at this point in the history
fix: 카카오 로그인 요청 헤더 추출 로직에서 NULL 예외처리 추가
  • Loading branch information
GitJIHO authored Oct 30, 2024
1 parent 15bbfdf commit 6aa1dc2
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ public KakaoApiService(RestTemplate restTemplate, KakaoProperties kakaoPropertie

public String getAuthorizationUrl(HttpServletRequest httpServletRequest) {
String requestUrl = httpServletRequest.getHeader("Referer");
if (requestUrl == null) {
throw new BadRequestException("해당 도메인에서는 카카오 로그인이 불가합니다.");
}
String redirectUri;

if (requestUrl.contains("localhost:5173")) {
Expand All @@ -49,6 +52,9 @@ public KakaoTokenResponse getAccessToken(String authorizationCode, HttpServletRe
headers.add(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED_VALUE);

String requestUrl = httpServletRequest.getHeader("Origin");
if (requestUrl == null) {
throw new BadRequestException("해당 도메인에서는 카카오 로그인이 불가합니다.");
}
String redirectUri;

if (requestUrl.contains("localhost:5173")) {
Expand Down

0 comments on commit 6aa1dc2

Please sign in to comment.