diff --git a/user-service/src/main/java/kr/mafoo/user/controller/AuthController.java b/user-service/src/main/java/kr/mafoo/user/controller/AuthController.java index b274df3..3c144a7 100644 --- a/user-service/src/main/java/kr/mafoo/user/controller/AuthController.java +++ b/user-service/src/main/java/kr/mafoo/user/controller/AuthController.java @@ -18,7 +18,7 @@ public class AuthController implements AuthApi { @Override public Mono loginWithKakao(KakaoLoginRequest request) { return authService - .loginWithKakao(request.code()) + .loginWithKakao(request.accessToken()) .map(authToken -> new LoginResponse(authToken.accessToken(), authToken.refreshToken())); } diff --git a/user-service/src/main/java/kr/mafoo/user/controller/dto/request/KakaoLoginRequest.java b/user-service/src/main/java/kr/mafoo/user/controller/dto/request/KakaoLoginRequest.java index e03d20b..bbed68d 100644 --- a/user-service/src/main/java/kr/mafoo/user/controller/dto/request/KakaoLoginRequest.java +++ b/user-service/src/main/java/kr/mafoo/user/controller/dto/request/KakaoLoginRequest.java @@ -4,7 +4,7 @@ @Schema(description = "카카오 로그인 요청") public record KakaoLoginRequest( - @Schema(description = "인가 코드", example = "test") - String code + @Schema(description = "카카오 엑세스 토큰", example = "test") + String accessToken ) { } diff --git a/user-service/src/main/java/kr/mafoo/user/service/AuthService.java b/user-service/src/main/java/kr/mafoo/user/service/AuthService.java index 9a2ce2f..c5d4da4 100644 --- a/user-service/src/main/java/kr/mafoo/user/service/AuthService.java +++ b/user-service/src/main/java/kr/mafoo/user/service/AuthService.java @@ -41,11 +41,9 @@ public class AuthService { private final AppleOAuthProperties appleOAuthProperties; private final ObjectMapper objectMapper; - @Transactional - public Mono loginWithKakao(String code) { - return getKakaoTokenWithCode(code) - .flatMap(this::getUserInfoWithKakaoToken) + public Mono loginWithKakao(String kakaoAccessToken) { + return getUserInfoWithKakaoToken(kakaoAccessToken) .flatMap(kakaoLoginInfo -> getOrCreateMember( IdentityProvider.KAKAO, kakaoLoginInfo.id(),