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]);