-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: 소셜 로그인 정보 조회하기 기능 구현 #220
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
카카오는 확인했는데 애플의 경우에도 이메일이 항상 넘어오는지만 확인 부탁드립니당
고생하셨어용🙇🏻
private void saveAndRegisterMember(OauthInfo oauthInfo) { | ||
Member member = Member.createGuestMember(oauthInfo, "testNickname"); | ||
memberRepository.save(member); | ||
member.register("testNickname"); | ||
PrincipalDetails principalDetails = new PrincipalDetails(1L, "USER"); | ||
Authentication authentication = | ||
new UsernamePasswordAuthenticationToken( | ||
principalDetails, null, principalDetails.getAuthorities()); | ||
SecurityContextHolder.getContext().setAuthentication(authentication); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
요렇게 메소드로 만들어두니까 깔끔하네용
return Arrays.stream(values()) | ||
.filter(oauthProvider -> oauthProvider.issuer.equals(issuer)) | ||
.findFirst() | ||
.orElseThrow(() -> new CustomException(ErrorCode.OAUTH_PROVIDER_NOT_FOUND)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻
private void validateSocialInfoNotNull(Member member) { | ||
if (member.getOauthInfo() == null) { | ||
throw new CustomException(ErrorCode.MEMBER_SOCIAL_INFO_NOT_FOUND); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻
애플 이메일 id token으로 넘어오는거 체크했습니다 감사용 |
🌱 관련 이슈
📌 작업 내용 및 특이사항
oidcUser
에서getEmail()
만 해주면 됨"provider": "KAKAO"
)of
로 순회하면서 issuer로 프로바이더 enum을 결정함📝 참고사항
📚 기타