From 6b05948566e842f2bbceca53b1fd2e89060035e1 Mon Sep 17 00:00:00 2001 From: yeon015 Date: Thu, 3 Oct 2024 20:21:37 +0900 Subject: [PATCH] =?UTF-8?q?fix/#235=20member=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/umc/th/juinjang/controller/OAuthController.java | 2 +- src/main/java/umc/th/juinjang/model/entity/Member.java | 4 ++-- src/main/java/umc/th/juinjang/service/auth/OAuthService.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/umc/th/juinjang/controller/OAuthController.java b/src/main/java/umc/th/juinjang/controller/OAuthController.java index cb835bc..4f69eae 100644 --- a/src/main/java/umc/th/juinjang/controller/OAuthController.java +++ b/src/main/java/umc/th/juinjang/controller/OAuthController.java @@ -148,7 +148,7 @@ public ApiResponse kakaoWithdraw(@AuthenticationPrincipal Member member, @Reques // 애플 탈퇴 @DeleteMapping("/withdraw/apple") public ApiResponse withdraw(@AuthenticationPrincipal Member member, - @Nullable@RequestHeader("X-Apple-Code") final String code, @RequestBody @Validated WithdrawReasonRequestDto withdrawReasonReqDto){ + @Nullable@RequestHeader("X-Apple-Code") final String code, @RequestBody WithdrawReasonRequestDto withdrawReasonReqDto){ oauthService.appleWithdraw(member, code); // 탈퇴 사유 추가 diff --git a/src/main/java/umc/th/juinjang/model/entity/Member.java b/src/main/java/umc/th/juinjang/model/entity/Member.java index ef86879..128e483 100644 --- a/src/main/java/umc/th/juinjang/model/entity/Member.java +++ b/src/main/java/umc/th/juinjang/model/entity/Member.java @@ -37,11 +37,11 @@ public class Member extends BaseEntity implements UserDetails { private MemberProvider provider; // apple client id값을 의미 - @Column(name = "apple_sub") + @Column(name = "apple_sub", unique = true) private String appleSub; // kakao target id값 의미 (카카오의 유저 식별값. 탈퇴할 때 필요) - @Column(name="target_id") + @Column(name="target_id", unique = true) private Long kakaoTargetId; @Lob diff --git a/src/main/java/umc/th/juinjang/service/auth/OAuthService.java b/src/main/java/umc/th/juinjang/service/auth/OAuthService.java index 844c86b..ee8c1ba 100644 --- a/src/main/java/umc/th/juinjang/service/auth/OAuthService.java +++ b/src/main/java/umc/th/juinjang/service/auth/OAuthService.java @@ -125,7 +125,7 @@ public LoginResponseDto kakaoSignUp (Long targetId, KakaoSignUpRequestDto kakaoS } } else if (getMember.isPresent() || getTargetId.isPresent()) { // 둘 중 하나만 존재할 때 실행될 코드 throw new MemberHandler(FAILED_TO_LOGIN); - } else { // 두 값 모두 존재하지 않을 때 실행될 코드, 아직 회원가입 하지 않은 회원인 경우 + } else if (!getMember.isPresent() && !getTargetId.isPresent()) { // 두 값 모두 존재하지 않을 때 실행될 코드, 아직 회원가입 하지 않은 회원인 경우 member = memberRepository.save( Member.builder() .email(email)