Skip to content

Commit 5698742

Browse files
committed
fix: 카카오 로깅 수정
1 parent 2a5d9da commit 5698742

File tree

1 file changed

+8
-3
lines changed
  • Location-based-target-authentication/src/main/java/com/swyp/social_login/service/auth

1 file changed

+8
-3
lines changed

Location-based-target-authentication/src/main/java/com/swyp/social_login/service/auth/KakaoAuthImpl.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
import org.springframework.util.MultiValueMap;
1010
import org.springframework.web.client.RestTemplate;
1111
import org.springframework.beans.factory.annotation.Value;
12+
import org.slf4j.Logger;
13+
import org.slf4j.LoggerFactory;
1214

1315
import java.util.Collections;
1416
import java.util.HashMap;
@@ -29,15 +31,18 @@ public class KakaoAuthImpl implements KakaoAuthService {
2931
private String KAKAO_REDIRECT_URL_LOCAL;
3032

3133
private final HttpServletRequest request;
34+
private static final Logger log = LoggerFactory.getLogger(KakaoAuthImpl.class);
3235

3336
public KakaoAuthImpl(HttpServletRequest request) {
3437
this.request = request;
3538
}
3639

3740
// 1. OAuth2 Access Token 발급
3841
@Override
39-
public String getAccessToken(String code) {
40-
System.out.println("[KakaoAuth] Authorization code 수신: " + code);
42+
public TokenDto getAccessToken(String code) {
43+
log.info("카카오 인증 코드: {}", code);
44+
log.info("사용하는 리다이렉트 URI: {}", redirectUri);
45+
4146
RestTemplate restTemplate = new RestTemplate();
4247

4348
HttpHeaders headers = new HttpHeaders();
@@ -67,7 +72,7 @@ public String getAccessToken(String code) {
6772
JsonNode jsonNode = objectMapper.readTree(response.getBody());
6873
String accessToken = jsonNode.get("access_token").asText();
6974
System.out.println("[KakaoAuth] Access Token 발급 성공");
70-
return accessToken;
75+
return new TokenDto(accessToken);
7176
} catch (Exception e) {
7277
System.err.println("[KakaoAuth] Access Token 발급 실패: " + e.getMessage());
7378
throw new RuntimeException("카카오 Access Token 요청 실패", e);

0 commit comments

Comments
 (0)