Skip to content
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(#37): 회원 이름 이메일 저장 #52

Merged
merged 7 commits into from
Feb 4, 2025

Conversation

kimyu0218
Copy link
Collaborator

@kimyu0218 kimyu0218 commented Feb 3, 2025

작업 개요

소셜 로그인 시 회원 이름 및 이메일 저장

작업 사항

  • 카카오 로그인 시 kakao_accountname, email도 받아오도록 수정
  • 애플 로그인 시 dto의 name과 authorization의 email 저장하도록 수정
  • 외부 api 응답 dto class에서 record로 변경

Copy link

github-actions bot commented Feb 3, 2025

Test Results

39 tests   38 ✅  2s ⏱️
23 suites   1 💤
23 files     0 ❌

Results for commit 13560d8.

♻️ This comment has been updated with latest results.

@kimyu0218 kimyu0218 force-pushed the feature/#37-회원-이름-이메일-저장 branch from 64b398d to 14ecfc0 Compare February 3, 2025 16:13
@kimyu0218 kimyu0218 changed the title Feature(#37): 회원 이름 이메일 저장 Feat(#37): 회원 이름 이메일 저장 Feb 3, 2025
@kimyu0218 kimyu0218 marked this pull request as ready for review February 3, 2025 16:23
Comment on lines +41 to +57
private SocialAccount createSocialAccount(
final Member member, final String oauthId, final SocialProvider socialProvider) {
return SocialAccountFixture.builder()
.member(member)
.oauthId(oauthId)
.socialProvider(socialProvider)
.build();
}

private AppleLoginCommand createAppleLoginCommand(String idToken, String name) {
return new AppleLoginCommand(idToken, name);
}

private KakaoLoginCommand createKakaoLoginCommand(String authorizationCode, String redirectUri) {
return new KakaoLoginCommand(authorizationCode, redirectUri);
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IntelliJ 설정에서 Actions on Save를 사용하고 있는데 자동으로 포맷팅해서 메서드가 클래스 위로 올라와 버렸습니다 😭
가독성에 방해된다면 해당 옵션 끄고 원상 복귀하여 다시 커밋하겠습니다..!

@kimyu0218 kimyu0218 added this to the 1차 MVP milestone Feb 3, 2025
@kimyu0218 kimyu0218 linked an issue Feb 3, 2025 that may be closed by this pull request
1 task
Copy link
Member

@NaMinhyeok NaMinhyeok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다 !!!

Comment on lines +24 to +29
private String email;

private Member(final String name, final String email) {
this.name = name;
this.email = email;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pn2. 별건 아닌데 email 검증해주는건 어떤가요 ?? 아니면 email을 VO로 만들어서 써도 좋을 것 같아여 !

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

시간되면 해주세요! 나중에 리팩토링해도 괜찮구요!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이건 다른 pr에 병목이 생길 것 같아 추후에 이슈 열어서 작업해보겠습니다!

Copy link
Member

@pythonstrup pythonstrup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다! 코멘트한 부분 수정 부탁드려요!

Comment on lines +7 to 13
public record KakaoUserInfoResponse(
@JsonProperty("id") Long id, @JsonProperty("kakao_account") KakaoAccount kakaoAccount) {

@JsonProperty("id")
Long id;
@JsonIgnoreProperties(ignoreUnknown = true)
public record KakaoAccount(
@JsonProperty("name") String name, @JsonProperty("email") String email) {}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inner class👍 👍 👍

Comment on lines 80 to 87
private Member findMemberWithSocialProvider(
final String oauthId, final SocialProvider socialProvider) {
return socialAccountRepository
.findByOauthIdAndSocialProviderAndDeletedAtIsNull(oauthId, socialProvider)
.map(SocialAccount::getMember)
.filter(member -> member.getDeletedAt() == null)
.orElse(null);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pn2. filter

  • @Query 사용해서 join을 하고, member.deletedAt is null을 검사하는 방법은 어떠신가요?
  • 조회 조건이 비즈니스 로직에 있어야하는 이유가 있을까요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

체이닝으로 변경하면서 사라졌습니다!

  • 지금 생각하니 쿼리 어노테이션으로 확인해도 되고
  • member 삭제 시 같이 삭제되니까 social account 의 deleted at 만 확인해도 되는 것 같네요

Comment on lines +24 to +29
private String email;

private Member(final String name, final String email) {
this.name = name;
this.email = email;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

시간되면 해주세요! 나중에 리팩토링해도 괜찮구요!

애플은 최초 로그인할 때만 name 값을 전달하므로 로그인 시엔 email만 업데이트 한다
@kimyu0218 kimyu0218 requested a review from pythonstrup February 4, 2025 12:27
Copy link
Member

@pythonstrup pythonstrup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다!

@kimyu0218 kimyu0218 merged commit dd66fa9 into main Feb 4, 2025
2 checks passed
@NaMinhyeok NaMinhyeok deleted the feature/#37-회원-이름-이메일-저장 branch February 15, 2025 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: 회원 이름, 이메일 저장
3 participants