feat: SSO 쿠키 인증 통합 + 서브도메인 라우팅 아키텍처

- Path-based 라우팅을 서브도메인 기반으로 전환
  (tkfb/tkreport/tkqc.technicalkorea.net)
- 3개 시스템 프론트엔드에 SSO 쿠키 인증 통합
  (domain=.technicalkorea.net, localStorage 폴백)
- Gateway: 포털+로그인+System1 프록시, 쿠키 SSO 설정
- System 1: 토큰키 통일, nginx.conf 생성, 신고페이지 리다이렉트
- System 2: api-base.js/app-init.js 생성, getSSOToken() 통합
- System 3: TokenManager 쿠키 지원, 중앙 로그인 리다이렉트
- docker-compose.yml에 cloudflared 서비스 추가
- DEPLOY-GUIDE.md 배포 가이드 작성

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Hyungi Ahn
2026-02-09 18:41:44 +09:00
parent 550633b89d
commit 6495b8af32
114 changed files with 1729 additions and 4335 deletions

View File

@@ -1,29 +1,33 @@
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>(주)테크니컬코리아 생산팀 포털</title>
<link rel="stylesheet" href="css/login.css" />
<link rel="icon" type="image/png" href="img/favicon.png">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>(주)테크니컬코리아 생산팀 포털</title>
<link rel="icon" type="image/png" href="img/favicon.png">
<script>
// SSO 토큰 확인 (쿠키 + localStorage)
(function() {
function cookieGet(name) {
var match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));
return match ? decodeURIComponent(match[1]) : null;
}
var token = cookieGet('sso_token') || localStorage.getItem('sso_token');
if (token && token !== 'undefined' && token !== 'null') {
window.location.replace('/pages/dashboard.html');
} else {
// 중앙 로그인으로 리다이렉트
var hostname = window.location.hostname;
if (hostname.includes('technicalkorea.net')) {
window.location.replace(window.location.protocol + '//tkfb.technicalkorea.net/login');
} else {
window.location.replace('/login');
}
}
})();
</script>
</head>
<body>
<div class="login-container">
<img src="img/logo.png" alt="테크니컬코리아 로고" class="logo" />
<h1>(주)테크니컬코리아</h1>
<h3>생산팀 포털 로그인</h3>
<form id="loginForm">
<input type="text" id="username" placeholder="아이디" required autocomplete="username" />
<input type="password" id="password" placeholder="비밀번호" required autocomplete="current-password" />
<button type="submit">로그인</button>
</form>
<div id="error" class="error-message"></div>
</div>
<!-- 스크립트 로딩 (순서 중요) -->
<script type="module" src="js/api-config.js"></script>
<script type="module" src="js/api-helper.js"></script>
<script type="module" src="js/login.js"></script>
<p>로딩 중...</p>
</body>
</html>
</html>