Skip to content

Commit

Permalink
Merge pull request #23 from kduoh99/Feat/#21
Browse files Browse the repository at this point in the history
Fix: 최초 로그인 여부 체크
  • Loading branch information
kduoh99 authored Nov 3, 2024
2 parents bbb89dc + 2690aac commit 7313cb5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,16 @@ public RspTemplate<ProfileResDto> updateProfile(

@PostMapping("/check-duplicate")
@Operation(
summary = "이메일 중복 검사",
description = "해당 사용자가 존재하는지 여부를 검사합니다.",
summary = "최초 로그인 여부 체크",
description = "해당 사용자가 최초 로그인인지 체크합니다.",
responses = {
@ApiResponse(responseCode = "200", description = "중복 검사 성공"),
@ApiResponse(responseCode = "200", description = "최초 로그인 여부 체크 성공"),
@ApiResponse(responseCode = "400", description = "잘못된 요청"),
@ApiResponse(responseCode = "500", description = "서버 오류")
}
)
public RspTemplate<String> checkDuplicateRequest(Principal principal) {
boolean isDuplicate = memberService.checkDuplicate(principal);
return new RspTemplate<>(HttpStatus.OK, String.valueOf(isDuplicate));
return new RspTemplate<>(HttpStatus.OK, "최초 로그인 여부 체크 성공", String.valueOf(isDuplicate));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public ProfileResDto updateProfile(Principal principal, UpdateProfileReqDto reqD

public boolean checkDuplicate(Principal principal) {
Member member = getMemberByPrincipal(principal);
return memberRepository.existsById(member.getId());
return member.getStack() == null || member.getPersona() == null || member.getAbility() == null;
}

private Member getMemberByPrincipal(Principal principal) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@
@Repository
public interface MemberRepository extends JpaRepository<Member, Long> {


Optional<Member> findByEmail(String email);
}

0 comments on commit 7313cb5

Please sign in to comment.