Skip to content

Commit

Permalink
fix: 회원가입시 중복 아이디 불가하게 설정
Browse files Browse the repository at this point in the history
- findByNickname 대신 findByLoginId 로 올바르게 로그인id를 찾음
  • Loading branch information
khee2 committed Aug 5, 2024
1 parent 616f0e1 commit 65c3742
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
public interface MemberRepository extends JpaRepository<Member, String> {
Optional<Member> findByEmail(String email);
Optional<Member> findByNickname(String nickname);

Optional<Member> findByLoginId(String loginId);
Optional<Member> findByEmailOrLoginId(String email, String nickname);
Optional<Member> findByName(String name);
}
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public boolean isNicknameAlreadyInUse(String nickname) {
* @return 로그인 아이디가 이미 사용 중이면 true, 아니면 false
*/
public boolean isLoginIdAlreadyInUse(String loginId) {
return memberRepository.findByNickname(loginId).isPresent();
return memberRepository.findByLoginId(loginId).isPresent();
}

/**
Expand Down

0 comments on commit 65c3742

Please sign in to comment.