로그인전 미사용상태 체크
This commit is contained in:
@@ -32,6 +32,11 @@ public class CustomAuthenticationProvider implements AuthenticationProvider {
|
||||
.findByUserId(username)
|
||||
.orElseThrow(() -> new CustomApiException(AuthErrorCode.LOGIN_ID_NOT_FOUND));
|
||||
|
||||
// 삭제 상태
|
||||
if (member.getStatus().equals(StatusType.DELETED.getId())) {
|
||||
throw new CustomApiException(AuthErrorCode.LOGIN_ID_NOT_FOUND);
|
||||
}
|
||||
|
||||
// jBCrypt + 커스텀 salt 로 저장된 패스워드 비교
|
||||
if (!BCrypt.checkpw(rawPassword, member.getPassword())) {
|
||||
// 실패 카운트 저장
|
||||
@@ -44,11 +49,6 @@ public class CustomAuthenticationProvider implements AuthenticationProvider {
|
||||
throw new CustomApiException(AuthErrorCode.LOGIN_PASSWORD_MISMATCH);
|
||||
}
|
||||
|
||||
// 삭제 상태
|
||||
if (member.getStatus().equals(StatusType.DELETED.getId())) {
|
||||
throw new CustomApiException(AuthErrorCode.LOGIN_ID_NOT_FOUND);
|
||||
}
|
||||
|
||||
// 패스워드 실패 횟수 체크
|
||||
if (member.getLoginFailCount() >= 5) {
|
||||
throw new CustomApiException(AuthErrorCode.LOGIN_PASSWORD_EXCEEDED);
|
||||
|
||||
Reference in New Issue
Block a user