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)