Skip to content

Commit

Permalink
Test: 로그 확인
Browse files Browse the repository at this point in the history
  • Loading branch information
eunxeum committed Nov 2, 2024
1 parent dfd5ee8 commit e8f4fc1
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,14 @@ public class CustomOAuth2UserService extends DefaultOAuth2UserService {
public OAuth2User loadUser(OAuth2UserRequest userRequest) {
OAuth2User oAuth2User = super.loadUser(userRequest);

logger.info("요기1");

String registrationId = userRequest.getClientRegistration().getRegistrationId();
String userNameAttributeName = userRequest.getClientRegistration().getProviderDetails()
.getUserInfoEndpoint().getUserNameAttributeName();

logger.info("요기2");

// Kakao 사용자 정보 추출
Long id = oAuth2User.getAttribute(userNameAttributeName);
Map<String, Object> properties = oAuth2User.getAttribute("properties");
Expand Down Expand Up @@ -65,9 +69,13 @@ public OAuth2User loadUser(OAuth2UserRequest userRequest) {
userRepository.save(userEntity);
}

logger.info("요기3");

// 권한 설정
GrantedAuthority authority = new SimpleGrantedAuthority("ROLE_USER");

logger.info("요기4");

// OAuth2User 반환
return new CustomOAuth2User(userEntity, Collections.singletonList(authority), oAuth2User.getAttributes());
}
Expand Down

0 comments on commit e8f4fc1

Please sign in to comment.