MD5 해시로 비밀번호 저장방식 변경
This commit is contained in:
parent
166004e8fd
commit
2ae43c879f
|
|
@ -170,7 +170,8 @@ export class AuthService {
|
||||||
[userInfo.company_code || "ILSHIN"]
|
[userInfo.company_code || "ILSHIN"]
|
||||||
);
|
);
|
||||||
|
|
||||||
const companyName = companyResult.length > 0 ? companyResult[0].company_name : undefined;
|
const companyName =
|
||||||
|
companyResult.length > 0 ? companyResult[0].company_name : undefined;
|
||||||
|
|
||||||
// DB에서 조회한 원본 사용자 정보 상세 로그
|
// DB에서 조회한 원본 사용자 정보 상세 로그
|
||||||
//console.log("🔍 AuthService - DB 원본 사용자 정보:", {
|
//console.log("🔍 AuthService - DB 원본 사용자 정보:", {
|
||||||
|
|
@ -358,7 +359,15 @@ export class AuthService {
|
||||||
vehicleType?: string;
|
vehicleType?: string;
|
||||||
}): Promise<{ success: boolean; message?: string }> {
|
}): Promise<{ success: boolean; message?: string }> {
|
||||||
try {
|
try {
|
||||||
const { userId, password, userName, phoneNumber, licenseNumber, vehicleNumber, vehicleType } = data;
|
const {
|
||||||
|
userId,
|
||||||
|
password,
|
||||||
|
userName,
|
||||||
|
phoneNumber,
|
||||||
|
licenseNumber,
|
||||||
|
vehicleNumber,
|
||||||
|
vehicleType,
|
||||||
|
} = data;
|
||||||
|
|
||||||
// 1. 중복 사용자 확인
|
// 1. 중복 사용자 확인
|
||||||
const existingUser = await query<any>(
|
const existingUser = await query<any>(
|
||||||
|
|
@ -386,9 +395,12 @@ export class AuthService {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3. 비밀번호 암호화
|
// 3. 비밀번호 암호화 (MD5 - 기존 시스템 호환)
|
||||||
const bcrypt = require("bcryptjs");
|
const crypto = require("crypto");
|
||||||
const hashedPassword = await bcrypt.hash(password, 10);
|
const hashedPassword = crypto
|
||||||
|
.createHash("md5")
|
||||||
|
.update(password)
|
||||||
|
.digest("hex");
|
||||||
|
|
||||||
// 4. 사용자 정보 저장 (user_info)
|
// 4. 사용자 정보 저장 (user_info)
|
||||||
await query(
|
await query(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue