diff --git a/src/main/java/Funssion/Inforum/domain/member/entity/CustomUserDetails.java b/src/main/java/Funssion/Inforum/domain/member/entity/CustomUserDetails.java index 718d7080..c3deaa0f 100644 --- a/src/main/java/Funssion/Inforum/domain/member/entity/CustomUserDetails.java +++ b/src/main/java/Funssion/Inforum/domain/member/entity/CustomUserDetails.java @@ -34,7 +34,7 @@ public class CustomUserDetails implements UserDetails, OAuth2User, Serializable public CustomUserDetails(String id, String roles, Map attributes) { //PrincipalOauth2UserService 참고 this.id = id; - this.authorities = createAuthoritiesOfSocial(roles); + this.authorities = createAuthoritiesOfSocial(roles,attributes); this.attributes = attributes; } @@ -57,12 +57,12 @@ private Collection createAuthoritiesOfNonSocial(String roles){ } return authorities; } - private Collection createAuthoritiesOfSocial(String roles){ + private Collection createAuthoritiesOfSocial(String roles,Map attributes){ Collection authorities = new ArrayList<>(); for(String role : roles.split(",")){ if (!StringUtils.hasText(role)) continue; - authorities.add(new OAuth2UserAuthority(role,this.attributes)); + authorities.add(new OAuth2UserAuthority(role,attributes)); } return authorities; }