From a2b2b3593cf94855ad48abafd97494b31492e199 Mon Sep 17 00:00:00 2001 From: Hyoseop Song Date: Mon, 30 Sep 2024 16:35:44 +0900 Subject: [PATCH] =?UTF-8?q?:bug:=20hotfix:=20=EC=B9=B4=EC=B9=B4=EC=98=A4?= =?UTF-8?q?=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20=EB=94=94=EB=B2=84=EA=B9=85=20?= =?UTF-8?q?=ED=99=98=EA=B2=BD=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../social/strategy/KakaoAuthStrategy.java | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/main/java/slvtwn/khu/toyouserver/common/authentication/social/strategy/KakaoAuthStrategy.java b/src/main/java/slvtwn/khu/toyouserver/common/authentication/social/strategy/KakaoAuthStrategy.java index 5e7a0d2..317b4e2 100644 --- a/src/main/java/slvtwn/khu/toyouserver/common/authentication/social/strategy/KakaoAuthStrategy.java +++ b/src/main/java/slvtwn/khu/toyouserver/common/authentication/social/strategy/KakaoAuthStrategy.java @@ -10,6 +10,7 @@ import slvtwn.khu.toyouserver.common.authentication.jwt.Token; import slvtwn.khu.toyouserver.common.feign.auth.kakao.KakaoAuthApiClient; import slvtwn.khu.toyouserver.common.feign.auth.kakao.KakaoResourceApiClient; +import slvtwn.khu.toyouserver.common.feign.auth.kakao.web.KakaoTokenResponse; import slvtwn.khu.toyouserver.common.feign.auth.kakao.web.KakaoUserResponse; import slvtwn.khu.toyouserver.domain.User; import slvtwn.khu.toyouserver.dto.SocialAuthRequest; @@ -39,17 +40,14 @@ public class KakaoAuthStrategy implements SocialAuthStrategy { @Override @Transactional public SocialAuthResponse login(SocialAuthRequest request) { -// KakaoTokenResponse tokenResponse = kakaoAuthApiClient.getOAuth2AccessToken( -// kakaoGrantType, -// kakaoClientId, -// kakaoRedirectUri, -// request.authorizationCode() -// ); -// KakaoUserResponse userResponse = kakaoResourceApiClient.getUserInformation( -// "Bearer " + tokenResponse.accessToken()); - + KakaoTokenResponse tokenResponse = kakaoAuthApiClient.getOAuth2AccessToken( + kakaoGrantType, + kakaoClientId, + kakaoRedirectUri, + request.authorizationCode() + ); KakaoUserResponse userResponse = kakaoResourceApiClient.getUserInformation( - "Bearer " + "5KPI3VXXHURq8oW-Tf4QakyEigvBgSNoAAAAAQo8JCAAAAGSQcoJl-AsyCcGfplL"); + "Bearer " + tokenResponse.accessToken()); User user = findOrCreateUser(userResponse); Token token = jwtProvider.issueTokens(user.getId()); return SocialAuthResponse.of(user.getId(), user.getName(), KAKAO, token);