diff --git a/src/main/java/com/onnoff/onnoff/auth/controller/LoginController.java b/src/main/java/com/onnoff/onnoff/auth/controller/LoginController.java index 0cbead2..91b4e01 100644 --- a/src/main/java/com/onnoff/onnoff/auth/controller/LoginController.java +++ b/src/main/java/com/onnoff/onnoff/auth/controller/LoginController.java @@ -44,6 +44,8 @@ public class LoginController { @Value("${kakao.redirect-uri}") private String redirectUri; + @Value("${kakao.client-id}") + private String kakaoClientId; @@ -54,7 +56,7 @@ public class LoginController { public String login(){ String toRedirectUri = UriComponentsBuilder.fromUriString("https://kauth.kakao.com/oauth/authorize") .queryParam("response_type", "code") - .queryParam("client_id", "32c0787d1b1e9fcabcc24af247903ba8") + .queryParam("client_id", kakaoClientId) .queryParam("redirect_uri", redirectUri) .toUriString(); return "redirect:" + toRedirectUri; diff --git a/src/main/java/com/onnoff/onnoff/auth/feignClient/dto/kakao/KakaoOauth2DTO.java b/src/main/java/com/onnoff/onnoff/auth/feignClient/dto/kakao/KakaoOauth2DTO.java index 20186ce..2e1604f 100644 --- a/src/main/java/com/onnoff/onnoff/auth/feignClient/dto/kakao/KakaoOauth2DTO.java +++ b/src/main/java/com/onnoff/onnoff/auth/feignClient/dto/kakao/KakaoOauth2DTO.java @@ -20,7 +20,7 @@ public static class TokenValidateResponseDTO{ @ToString public static class UserInfoResponseDTO{ private String sub; - private String name; + private String nickname; private String email; } } diff --git a/src/main/java/com/onnoff/onnoff/domain/user/converter/UserConverter.java b/src/main/java/com/onnoff/onnoff/domain/user/converter/UserConverter.java index d42d469..99515ac 100644 --- a/src/main/java/com/onnoff/onnoff/domain/user/converter/UserConverter.java +++ b/src/main/java/com/onnoff/onnoff/domain/user/converter/UserConverter.java @@ -11,7 +11,7 @@ public static User toUser(KakaoOauth2DTO.UserInfoResponseDTO response){ return User.builder() .oauthId(response.getSub()) .email(response.getEmail()) - .name(response.getName()) + .name(response.getNickname()) .socialType(SocialType.KAKAO) .build(); } diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 7c25337..3a7742c 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,4 +1,10 @@ spring: + cloud: + openfeign: + client: + config: + default: + logger-level: FULL profiles: active: dev jwt: