관리자 관리 수정

This commit is contained in:
2025-12-12 17:18:14 +09:00
parent 61255b4602
commit 41f7afca96
20 changed files with 179 additions and 145 deletions

View File

@@ -30,8 +30,8 @@ public class CustomAuthenticationProvider implements AuthenticationProvider {
.findByUserId(username)
.orElseThrow(() -> new CustomApiException(AuthErrorCode.LOGIN_ID_NOT_FOUND));
// 삭제 상태
if (member.getStatus().equals(StatusType.DELETED.getId())) {
// 미사용 상태
if (member.getStatus().equals(StatusType.INACTIVE.getId())) {
throw new CustomApiException(AuthErrorCode.LOGIN_ID_NOT_FOUND);
}
@@ -39,15 +39,12 @@ public class CustomAuthenticationProvider implements AuthenticationProvider {
if (!BCrypt.checkpw(rawPassword, member.getPassword())) {
// 실패 카운트 저장
int cnt = member.getLoginFailCount() + 1;
if (cnt >= 5) {
member.setStatus(StatusType.INACTIVE.getId());
}
member.setLoginFailCount(cnt);
membersRepository.save(member);
throw new CustomApiException(AuthErrorCode.LOGIN_PASSWORD_MISMATCH);
}
// 패스워드 실패 횟수 체크
// 로그인 실패 체크
if (member.getLoginFailCount() >= 5) {
throw new CustomApiException(AuthErrorCode.LOGIN_PASSWORD_EXCEEDED);
}