From 05ad8f41f94c8bce4a96b391cc684bf12d0a9e56 Mon Sep 17 00:00:00 2001 From: YoungJun Park Date: Thu, 7 Oct 2021 18:19:23 +0900 Subject: [PATCH] =?UTF-8?q?[#4]=20=EC=9D=B4=EB=A9=94=EC=9D=BC=20=EC=A4=91?= =?UTF-8?q?=EB=B3=B5=EB=90=98=EB=8A=94=20=EA=B2=BD=EC=9A=B0=20oauthId?= =?UTF-8?q?=EB=A1=9C=20=EB=B6=84=EB=A5=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lazy/api/config/auth/dto/OAuthAttributes.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/api/src/main/java/com/teamnexters/lazy/api/config/auth/dto/OAuthAttributes.java b/api/src/main/java/com/teamnexters/lazy/api/config/auth/dto/OAuthAttributes.java index abb1dde..a416a5c 100644 --- a/api/src/main/java/com/teamnexters/lazy/api/config/auth/dto/OAuthAttributes.java +++ b/api/src/main/java/com/teamnexters/lazy/api/config/auth/dto/OAuthAttributes.java @@ -17,6 +17,7 @@ @Getter public class OAuthAttributes { private final Map attributes; // OAuth2 반환하는 유저 정보 Map + private final Integer oauthId; private final String nameAttributeKey; private final String name; private final String email; @@ -39,6 +40,7 @@ public static OAuthAttributes of(String provider, String userNameAttributeName, private static OAuthAttributes ofGoogle(String userNameAttributeName, Map attributes) { return OAuthAttributes.builder() + .oauthId((Integer) attributes.get("id")) .name((String) attributes.get("name")) .email((String) attributes.get("email")) .picture((String) attributes.get("picture")) @@ -55,6 +57,7 @@ private static OAuthAttributes ofKakao(Map attributes) { Map kakaoProfile = (Map) kakaoAccount.get("profile"); return OAuthAttributes.builder() + .oauthId((Integer) attributes.get("id")) .name((String) kakaoProfile.get("nickname")) .email((String) kakaoAccount.get("email")) .picture((String) kakaoProfile.get("profile_image_url")) @@ -79,8 +82,11 @@ private static OAuthAttributes ofNaver(Map attributes) { public Member toEntity(){ return Member.builder() + .oauthId(oauthId) + .password(null) .name(name) .email(email) + .nickName(null) .picture(picture) .role(Role.USER) // 기본 권한 GUEST, 일반 : USER .provider(provider)