Skip to content

Commit

Permalink
feat: change kakao auth code to access token
Browse files Browse the repository at this point in the history
  • Loading branch information
CChuYong committed Jul 24, 2024
1 parent 8b32eed commit 5a14063
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class AuthController implements AuthApi {
@Override
public Mono<LoginResponse> loginWithKakao(KakaoLoginRequest request) {
return authService
.loginWithKakao(request.code())
.loginWithKakao(request.accessToken())
.map(authToken -> new LoginResponse(authToken.accessToken(), authToken.refreshToken()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

@Schema(description = "카카오 로그인 요청")
public record KakaoLoginRequest(
@Schema(description = "인가 코드", example = "test")
String code
@Schema(description = "카카오 엑세스 토큰", example = "test")
String accessToken
) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ public class AuthService {
private final ObjectMapper objectMapper;


public Mono<AuthToken> loginWithKakao(String code) {
return getKakaoTokenWithCode(code)
.flatMap(this::getUserInfoWithKakaoToken)
public Mono<AuthToken> loginWithKakao(String kakaoAccessToken) {
return getUserInfoWithKakaoToken(kakaoAccessToken)
.flatMap(kakaoLoginInfo -> getOrCreateMember(
IdentityProvider.KAKAO,
kakaoLoginInfo.id(),
Expand Down

0 comments on commit 5a14063

Please sign in to comment.