refactor: System1 API 인증 체계 SSO 전환 및 마이그레이션 정비
- SSO JWT 인증으로 전환 (auth.service.js) - worker_id → user_id 마이그레이션 완료 - departments 연동, CORS 미들웨어 정리 - 불필요 파일 삭제 (tk_database.db, visitRequestController.js) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -174,7 +174,6 @@ const remove = async (userId) => {
|
||||
try {
|
||||
await conn.beginTransaction();
|
||||
|
||||
console.log(`🗑️ 작업자 삭제 시작: user_id=${userId}`);
|
||||
|
||||
// 안전한 삭제: 각 테이블을 개별적으로 처리하고 오류가 발생해도 계속 진행
|
||||
const tables = [
|
||||
@@ -195,10 +194,8 @@ const remove = async (userId) => {
|
||||
try {
|
||||
const [result] = await conn.query(table.query, [userId]);
|
||||
if (result.affectedRows > 0) {
|
||||
console.log(`✅ ${table.name} 테이블 ${table.action}: ${result.affectedRows}건`);
|
||||
}
|
||||
} catch (tableError) {
|
||||
console.log(`⚠️ ${table.name} 테이블 ${table.action} 실패 (무시): ${tableError.message}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -207,14 +204,13 @@ const remove = async (userId) => {
|
||||
`DELETE FROM workers WHERE user_id = ?`,
|
||||
[userId]
|
||||
);
|
||||
console.log(`✅ 작업자 삭제 완료: ${result.affectedRows}건`);
|
||||
|
||||
await conn.commit();
|
||||
return result.affectedRows;
|
||||
|
||||
} catch (err) {
|
||||
await conn.rollback();
|
||||
console.error(`❌ 작업자 삭제 오류 (user_id: ${userId}):`, err);
|
||||
console.error(` 작업자 삭제 오류 (user_id: ${userId}):`, err);
|
||||
throw new Error(`작업자 삭제 중 오류가 발생했습니다: ${err.message}`);
|
||||
} finally {
|
||||
conn.release();
|
||||
|
||||
Reference in New Issue
Block a user