Skip to content

Commit

Permalink
style: 로그인 실패 로그 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Arachneee committed Nov 18, 2024
1 parent c8379ff commit c61cdd8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
11 changes: 7 additions & 4 deletions server/src/main/java/haengdong/user/application/KakaoClient.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
package haengdong.user.application;

import haengdong.common.exception.HaengdongErrorCode;
import haengdong.common.exception.HaengdongException;
import haengdong.user.application.response.KakaoTokenResponse;
import haengdong.user.config.KakaoProperties;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestClient;
import haengdong.user.application.response.KakaoTokenResponse;
import haengdong.user.config.KakaoProperties;
import haengdong.common.exception.HaengdongErrorCode;
import haengdong.common.exception.HaengdongException;

@Slf4j
@RequiredArgsConstructor
@EnableConfigurationProperties(KakaoProperties.class)
@Component
Expand All @@ -36,6 +38,7 @@ public KakaoTokenResponse join(String code, String redirectUri) {
.retrieve()
.body(KakaoTokenResponse.class);
} catch (Exception e) {
log.info("로그인 실패 : {}", code);
throw new HaengdongException(HaengdongErrorCode.KAKAO_LOGIN_FAIL, e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
import com.auth0.jwt.JWT;
import com.auth0.jwt.interfaces.DecodedJWT;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import haengdong.user.application.response.KakaoTokenResponse;

@Slf4j
@RequiredArgsConstructor
@Service
public class KakaoUserService {
Expand All @@ -23,6 +25,8 @@ public Long joinByKakao(String code, String redirectUri) {
String memberNumber = decodedJWT.getSubject();
String nickname = decodedJWT.getClaim(NICKNAME_KEY).asString();

log.info("로그인 성공 : {}, {}", code, nickname);

return userService.join(memberNumber, nickname);
}

Expand Down

0 comments on commit c61cdd8

Please sign in to comment.