Skip to content

Commit

Permalink
카카오 로그인 로컬테스트
Browse files Browse the repository at this point in the history
  • Loading branch information
hysong4u committed Feb 15, 2024
1 parent 43af3d0 commit 7de2df3
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.springframework.web.client.RestTemplate;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;

Expand All @@ -47,7 +48,7 @@ private String issueNewRefreshToken(Long memberId) {
private String clientId;

@Value("${spring.security.oauth2.client.registration.kakao.redirect-uri}")
private String redirectUri;
private List<String> redirectUri;

@Value("${jwt.refresh-token-expire-time}")
private long REFRESH_TOKEN_EXPIRE_TIME;
Expand All @@ -67,7 +68,11 @@ public KakaoUserInfoResponseDto kakaoCallback(String code, String environment) {
MultiValueMap<String, String> params = new LinkedMultiValueMap<>();
params.add("grant_type", "authorization_code");
params.add("client_id", clientId);
params.add("redirect_uri", redirectUri);
if ("production".equals(environment)) {
params.add("redirect_uri", redirectUri.get(0));
} else {
params.add("redirect_uri", redirectUri.get(1));
}
params.add("code", code);

HttpEntity<MultiValueMap<String, String>> kakaoTokenRequest =
Expand Down

0 comments on commit 7de2df3

Please sign in to comment.