diff --git a/WebContent/jsp/common/screen/emergency.jsp b/WebContent/jsp/common/screen/emergency.jsp index 16ca022..b503f2e 100644 --- a/WebContent/jsp/common/screen/emergency.jsp +++ b/WebContent/jsp/common/screen/emergency.jsp @@ -299,8 +299,12 @@ if (response.smsAuthRequired) { // 비밀번호는 아직 반영되지 않음 - SMS 인증 완료 시 최종 반영됨 smsAuthPurpose = 'PASSWORD_CHANGE'; + // 두 모달이 겹치면 이전 모달의 enforceFocus/backdrop 이 남아 입력이 막히므로 + // #pwdChgModal 이 완전히 닫힌 뒤 SMS 인증 모달을 연다 + $('#pwdChgModal').one('hidden.bs.modal', function() { + showSmsAuthModal(response); + }); $('#pwdChgModal').modal('hide'); - showSmsAuthModal(response); return; } alert(response.message); @@ -369,6 +373,19 @@ verifySmsAuthCode(); } }); + + // 인증번호는 숫자만 허용 (타이핑/붙여넣기/드래그 공통, 백스페이스·방향키는 방해하지 않음) + $("#smsAuthCode").on("input", function(){ + var digits = this.value.replace(/[^0-9]/g, '').slice(0, 6); + if (this.value !== digits) { + this.value = digits; + } + }); + + // SMS 인증 모달이 완전히 열린 뒤 인증번호 입력창에 포커스 + $('#smsAuthModal').on('shown.bs.modal', function() { + $('#smsAuthCode').trigger('focus'); + }); }); function fncSsoLogin() { @@ -487,8 +504,7 @@
인증번호가 로 발송되었습니다.
남은 시간: 60초
diff --git a/src/main/java/com/eactive/eai/rms/common/context/MonitoringContext.java b/src/main/java/com/eactive/eai/rms/common/context/MonitoringContext.java index 5f9c3b6..5230b33 100644 --- a/src/main/java/com/eactive/eai/rms/common/context/MonitoringContext.java +++ b/src/main/java/com/eactive/eai/rms/common/context/MonitoringContext.java @@ -273,6 +273,9 @@ public interface MonitoringContext { // 비밀번호 변경 시 재사용을 금지할 최근 이력 개수 public static final String RMS_PASSWORD_HISTORY_COUNT = "rms.password.history.count"; + // 비밀번호 변경 시 SMS 2차 인증 사용 여부 (djb.sms_auth.enabled 와 함께 true 여야 동작) + public static final String RMS_PASSWORD_SMS_AUTH_ENABLED = "rms.password.sms_auth.enabled"; + // API 상태변화 스윙챗 발송여부 public static final String DJB_UMS_MESSENGER_APIMONITOR_ENABLED = "djb.ums.messenger.api-monitor.enabled"; diff --git a/src/main/java/com/eactive/eai/rms/common/login/MainController.java b/src/main/java/com/eactive/eai/rms/common/login/MainController.java index bed49f0..a95d81b 100644 --- a/src/main/java/com/eactive/eai/rms/common/login/MainController.java +++ b/src/main/java/com/eactive/eai/rms/common/login/MainController.java @@ -464,6 +464,11 @@ public class MainController implements InterceptorSkipController { MonitoringContext.RMS_PASSWORD_HISTORY_COUNT, DEFAULT_PASSWORD_HISTORY_COUNT); } + // 비밀번호 변경 시 SMS 2차 인증 사용 여부 (djb.sms_auth.enabled 와 rms.password.sms_auth.enabled 가 모두 true 여야 동작) + private boolean isPasswordChangeSmsAuthEnabled() { + return monitoringContext.getBooleanProperty(MonitoringContext.RMS_PASSWORD_SMS_AUTH_ENABLED, false); + } + // 로그인 실패 횟수 증가, 임계치 도달 시 계정 잠금 private int increaseLoginFailCount(UserInfo userInfo) { int failCount = (userInfo.getLoginfailcount() == null ? 0 : userInfo.getLoginfailcount()) + 1; @@ -909,8 +914,9 @@ public class MainController implements InterceptorSkipController { } // 5. SMS 2차 인증 필요 여부 체크 (비상모드는 로그인과 동일하게 우회) + // djb.sms_auth.enabled 와 rms.password.sms_auth.enabled 가 모두 true 일 때만 SMS 인증 수행 Boolean emergencyMode = (Boolean) session.getAttribute("emergencyMode"); - if (!Boolean.TRUE.equals(emergencyMode) && smsAuthService.isEnabled()) { + if (!Boolean.TRUE.equals(emergencyMode) && smsAuthService.isEnabled() && isPasswordChangeSmsAuthEnabled()) { if (!smsAuthService.hasValidPhoneNumber(userInfo)) { UserAccessLogger.log(request, LOG_CATEGORY_LOGIN, "F", "휴대폰번호 미등록으로 비밀번호 변경 불가"); return ChangePasswordResponseDto.builder()