Skip to content

Commit

Permalink
Merge pull request #91 from Princess-in-silvertown/fix/delete-social-…
Browse files Browse the repository at this point in the history
…debug-setting

Hotfix: 카카오 로그인 디버깅 환경 분리
  • Loading branch information
loveysuby authored Sep 30, 2024
2 parents e53930f + a2b2b35 commit a68fd59
Showing 1 changed file with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit a68fd59

Please sign in to comment.