From 3dacd15a920437c3cedf04bf2ebf33f0ed90ba34 Mon Sep 17 00:00:00 2001 From: kjs Date: Thu, 2 Apr 2026 16:00:50 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EB=B9=84=EB=B0=80=EB=B2=88?= =?UTF-8?q?=ED=98=B8=20=EA=B2=80=EC=A6=9D=20=EB=A1=9C=EC=A7=81=20=EB=B0=8F?= =?UTF-8?q?=20=EC=95=94=ED=98=B8=ED=99=94=20=EB=B0=A9=EC=8B=9D=20=EA=B0=9C?= =?UTF-8?q?=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 비밀번호 길이 검증 로직 제거: 비밀번호 길이 검증을 서버에서 처리하지 않도록 변경하여 클라이언트 측에서 유효성 검사를 수행하도록 함. - 암호화 방식 변경: 기존의 암호화 로직을 EncryptUtil을 사용하여 간소화하고 일관성을 유지함. - 사용자 비밀번호 재설정 시 알림 상태 초기화: 비밀번호 재설정 모달에서 알림 상태를 초기화하여 사용자 경험 개선. --- .../src/controllers/adminController.ts | 23 ++----------------- .../admin/UserPasswordResetModal.tsx | 1 + 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/backend-node/src/controllers/adminController.ts b/backend-node/src/controllers/adminController.ts index 1501a2c0..5b462607 100644 --- a/backend-node/src/controllers/adminController.ts +++ b/backend-node/src/controllers/adminController.ts @@ -3728,16 +3728,6 @@ export const resetUserPassword = async ( return; } - // 비밀번호 길이 검증 (최소 4자) - if (newPassword.length < 4) { - res.status(400).json({ - success: false, - result: false, - message: "비밀번호는 최소 4자 이상이어야 합니다.", - msg: "비밀번호는 최소 4자 이상이어야 합니다.", - }); - return; - } try { // 1. Raw Query로 사용자 존재 여부 확인 @@ -3756,19 +3746,10 @@ export const resetUserPassword = async ( return; } - // 2. 비밀번호 암호화 (기존 Java 로직과 동일) + // 2. 비밀번호 암호화 (EncryptUtil 사용) let encryptedPassword: string; try { - // EncryptUtil과 동일한 암호화 사용 - const crypto = require("crypto"); - const keyName = "ILJIAESSECRETKEY"; - const algorithm = "aes-128-ecb"; - - // AES-128-ECB 암호화 - const cipher = crypto.createCipher(algorithm, keyName); - let encrypted = cipher.update(newPassword, "utf8", "hex"); - encrypted += cipher.final("hex"); - encryptedPassword = encrypted.toUpperCase(); + encryptedPassword = EncryptUtil.encrypt(newPassword); } catch (encryptError) { logger.error("비밀번호 암호화 중 오류 발생", { error: encryptError, diff --git a/frontend/components/admin/UserPasswordResetModal.tsx b/frontend/components/admin/UserPasswordResetModal.tsx index 72bd53d1..9dc1967b 100644 --- a/frontend/components/admin/UserPasswordResetModal.tsx +++ b/frontend/components/admin/UserPasswordResetModal.tsx @@ -114,6 +114,7 @@ export function UserPasswordResetModal({ isOpen, onClose, userId, userName, onSu setShowPassword(false); setShowConfirmPassword(false); setIsLoading(false); + setAlertState({ isOpen: false, type: "info", title: "", message: "" }); onClose(); }, [onClose]);