Skip to content

Commit

Permalink
Merge pull request #68 from Na-o-man/fix/#66/change-check-registratio…
Browse files Browse the repository at this point in the history
…n-logic

[FIX] 회원가입 여부 확인 로직 변경
  • Loading branch information
bflykky authored Aug 6, 2024
2 parents 7fd2ca6 + 21addca commit 09223c5
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,19 @@ public class MemberServiceImpl implements MemberService {
@Value("${jwt.refresh-token-validity-in-seconds}")
private Long REFRESH_TOKEN_VALIDITY_IN_SECONDS;

@Override
@Transactional
public LoginInfo signup(String tempMemberInfo, MarketingAgreedRequest request) {
Claims payload = jwtUtils.getPayload(tempMemberInfo);
SignupRequest signupRequest = memberConverter.toSignupRequest(payload, request.getMarketingAgreed());

return signup(signupRequest);
}

@Override
@Transactional
public LoginInfo signup(SignupRequest request) {
if (memberRepository.existsByEmail(request.getEmail())) {
if (memberRepository.existsBySocialTypeAndAuthId(request.getSocialType(), request.getAuthId())) {
throw new BusinessException(MEMBER_ALREADY_SIGNUP);
}

Expand All @@ -55,14 +64,6 @@ public LoginInfo signup(SignupRequest request) {
return memberConverter.toLoginInfo(memberId, accessToken, refreshToken);
}

@Override
@Transactional
public LoginInfo signup(String tempMemberInfo, MarketingAgreedRequest request) {
Claims payload = jwtUtils.getPayload(tempMemberInfo);
SignupRequest signupRequest = memberConverter.toSignupRequest(payload, request.getMarketingAgreed());

return signup(signupRequest);
}

@Override
public LoginInfo login(LoginRequest request) {
Expand Down Expand Up @@ -100,5 +101,4 @@ public Member findMember(SocialType socialType, String authId) {
return memberRepository.findByAuthIdAndSocialType(authId, socialType)
.orElseThrow(() -> new BusinessException(MEMBER_NOT_FOUND_BY_AUTH_ID_AND_SOCIAL_TYPE));
}

}

0 comments on commit 09223c5

Please sign in to comment.